VTI Instruments Corp.
APPENDIX B
30
_bstr_t option_string = "Cache=False, DriverSetup = preferpcieconnection = true";
_bstr_t resource = "TCPIP::127.0.0.1::slot1_3::INSTR";
digitizer->Initialize(resource,VARIANT_FALSE,VARIANT_TRUE,option_string);
// The above call opens a connection to the card plugged in the chassis.
// If Initialize call fails, a null value is returned to the driver.
// Below is a sample code.
_bstr_t option_string = "Cache=False, DriverSetup = preferpcieconnection = true ";
_bstr_t resource = "TCPIP::127.0.0.1::slot1_3::INSTR";
IVTEXDigitizerPtr digitizer(__uuidof(VTEXDigitizer));
digitizer->Initialize(resource, VARIANT_FALSE, VARIANT_TRUE, option_string);
#ifdef ADLINK_TRIGGER_ROUTING
using_2500 = false;
#endif
// Initialize the Digitizer driver
if(using_2500)
{
digitizer->Initialize(resource, VARIANT_FALSE, VARIANT_TRUE, "");
std::cout << "initialized" << std::endl;
}
else
{
digitizer->Initialize(resource, VARIANT_FALSE, VARIANT_TRUE, option_string);
std::cout << "initialized with direct PCIe" << std::endl;
fprintf(fs, "initialized with direct PCIe\n");
}
if(using_2500)
{
digitizer->ReferenceOscillator->Source = VTEXDigitizerReferenceOscillatorSourceSystem;
digitizer->ReferenceOscillator->TimestampSource = \
VTEXDigitizerReferenceOscillatorTimestampSourceSystem;
}
digitizer->Measurement->Sampling->ClockFrequency = clock_rate;
digitizer->Measurement->Sampling->SampleRate = clock_rate / (double)clock_divider;
digitizer->Measurement->Sampling->RecordSize = record_size;
double sample_rate = digitizer->Measurement->Sampling->SampleRate;
if(using_2500)
{