User manual

Programmer’s Guide Page 45 of 64
1. Configure the APXXX for appropriate channel, timebase, trigger, and gate parameters.
2. Start the first acquisition.
3. Give the order to switch banks and start the next acquisition and data processing on the current acquisition
as soon as possible. The processing can overlap with the data acquisition since it automatically deals with
the memory bank that is not selected for acquisition. If you need to read the original data choose the "no
processing" option.
4. Wait for the processing to be terminated, read the processed result. Note that the processing will not destroy
the originally acquired data.
5. You may now do any additional processing in your computer. However, you cannot read the original data
at this point without perturbing the acquisition.
6. Now that you have finished all work with the current data you can loop to (3) above.
A typical acquisition/processing/readout sequence in explicit buffered mode would be:
7. Configure the APX01 for appropriate channel, timebase, trigger, and gate parameters.
8. Start the first acquisition.
9. Wait for the first acquisition to terminate.
10. Switch the memory bank and start a new acquisition in the second bank. Note that you must start the new
acquisition to make the memory bank switch happen.
11. Start data processing. This can overlap with the data acquisition since it automatically deals with the
memory bank that is not selected for acquisition.
12. After processing has terminated, read the processed result. Note that the processing will not destroy the
originally acquired data.
13. You may now do any additional processing in your computer. However, you cannot read the original data
at this point without perturbing the acquisition.
14. Wait for the new acquisition to terminate.
15. If you need to read the original data, e.g. for diagnostics on the processing algorithm, you may now do so.
16. Loop to (4.) above.
You need to implement a method to interrupt the infinite loop whenever required. However, you should make sure
that you leave the acquisition in a well-determined state for future operation.
The explicit acquisition/processing/readout sequence described above is shown in the following code:
AqReadParameters readParams; // Read Definitions
AqDataDescriptor dataDesc; // Returned waveform values
long channel = 1, segmentNumber = 0;
long nbrPeaks = 2 * nbrGates; // nbrGates is defined by user
long waveformArray[2 * nbrPeaks];
long memoryBank = 0, timeout = 5000; // timeout = 5 seconds
// Insert whatever is required for Vertical
// and Trigger configuration
AcqrsD1_configMode(instrID, 3, 0, memoryBank);
AcqrsD1_acquire(instrID); // Acquire into bank 0
AcqrsD1_waitForEndOfAcquisition(instrID, timeout);
// At this point, you should check the return value!