User manual
Programmer’s Guide Page 16 of 64
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]);
}
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.
NOTE: The AcqrsXX_get functions return the configuration values to be used for the next acquisition.
Use the following short code fragment for a device configuration:
// Configure
double sampInterval = 1.e-9, delayTime = 0.0;
long nbrSamples = 10000, nbrSegments = 1;
long channel = 1, coupling = 1, bandwidth = 0;
double fullScale = 2.0, offset = 0.0;
long trigCoupling = 0, trigSlope = 0;
double trigLevel = 20.0; // in % of vertical Full Scale !
AcqrsD1_configHorizontal(instrID, sampInterval, delayTime);
AcqrsD1_configMemory(instrID, nbrSamples, nbrSegments);
AcqrsD1_configVertical(instrID, channel, fullScale, offset, coupling,
bandwidth);
AcqrsD1_configTrigClass(instrID, 0, 0x00000001, 0, 0, 0.0, 0.0);
AcqrsD1_configTrigSource(instrID, channel, trigCoupling, trigSlope,
trigLevel, 0.0);