User manual

Programmer’s Guide Page 22 of 66
3.2.10. Simulated Devices
If you want to work with simulated devices, none of the methods above are applicable. Many digitizer modules
supported by the driver can be simulated; analyzers and averagers generate data in digitizer mode. Any memory
option available for the module can be used for a call to Acqrs_setSimulationOptions as shown in this code
fragment:
ViSession instrumentID;
ViStatus status;
status = Acqrs_setSimulationOptions("M2M");
// Initialize the instrument
status = Acqrs_InitWithOptions("PCI::DC110", VI_FALSE, VI_FALSE,
"simulate=TRUE", &(instrumentID));
The first function call sets the instrument options that you want to obtain, e.g. “M2M” for the long memory option of
a DC110. In the second call, you must specify “simulate=TRUE” (without any spaces!). The device driver creates a
simulated device of your choice. The resource name string is always of the form “PCI::aannn”, where aannn is a
valid instrument module name.
The simulation options will apply to all subsequent calls to Acqrs_InitWithOptions, until they are reset with
Acqrs_setSimulationOptions ("").
3.2.11. Terminating an Application
For an orderly shut down of your application, we recommend the following sequence:
// Stop the instruments
for (long i = 0; i < nbrInstruments; i++)
{
status = AcqrsD1_stopAcquisition(instrumentID[i]);
// or status = AcqrsT3_stopAcquisition(instrumentID[i]);
}
Acqrs_closeAll();
Stopping the acquisition of all instruments ensures that there is no further activity that could, for example, generate
an interrupt. The function Acqrs_closeAll shuts down the driver components in the correct order, and thus helps
avoid crashes of the application during closing
3.2.12. Reinitialization
If the operating system of the computer goes into hibernate or stand-by then the driver will return an error,
ACQIRIS_ERROR_IO_DEVICE_OFF, when the application starts to use the hardware again. In this case the device
will not be useable until an Acqrs_Init… routine is called.
3.3. Device Configuration
As a general rule it should be remembered that new values to be used by the modules, as set with the
AcqrsXX_config functions, are remembered by the driver software but not immediately acted upon. They will only
really be loaded into the instrument‟s registers at the beginning of an acquisition when AcqrsXX_acquire is called.
At that time all necessary changes will be made and, depending on the type of changes, the driver will force itself to
wait the appropriate settling time before it starts the acquisition. This is done to ensure that the acquisition will occur
in the desired state. The program does not have to include ad hoc waits to allow the analog hardware to settle. The
settling times vary from none in the case of no change, to ~0.5 ms in the case of offset changes and to ~5 ms for relay
changes or changes between normal operation and External Clock Reference. In the special case of switching from
DC to AC coupling, the settling time is 100 ms. Time base setting changes also have associated settling times.
NOTE: The special case of making transitions from low to high impedance is treated immediately to avoid the risk
of damaging the front-end circuitry of the digitizer. When making transitions from high to low impedance you must
ensure that large voltages are not applied before the change has really happened. Therefore it is recommended to
wait ~5 ms after having asked for an impedance change and before applying any large voltages. Impedance changes
can also affect other devices in the signal path.
Unneeded calls to the AcqrsXX_config functions should be avoided because they can delay the start of the next
acquisition.