User manual
Programmer’s Guide Page 34 of 64
3.11. D1-style Data Readout
For the reading of standard waveforms the AcqrsD1_readData routine should be used. The following older
routines will remain available but will no longer be discussed:
AcqrsD1_readCharWform
AcqrsD1_readCharSequence
AcqrsD1_readRealWform
AcqrsD1_readRealSequence
AcqrsD1_accumulateWform
You should use the function AcqrsD1_readData for all new programs. The older functions will not give support for
new instruments or new functionality. All variables of the AqReadParameters structure should be initialized; 0 can
be used for the reserved words.
For the readout of the averager data the read function AcqrsD1_readData described in 3.10.1 Reading Digitizer
Waveforms with the Universal Read Function should be used with readMode = 2 (ReadModeAvgW). For
reading data from analyzers please refer to 3.10.7 Reading SSR Analyzer Waveforms, 3.10.8 Reading AP family
PeakTDC Analyzer Data and Histograms, 3.10.9 Reading U1084A PeakTDC Waveforms and Histograms, or
3.10.10 Reading AP101/AP201 Analyzer Waveforms.
3.11.1. Reading Digitizer Waveforms with the Universal Read Function
For the general case, which includes the reading of more complex waveforms, we provide a universal read function
AcqrsD1_readData.
Control of the read parameters is passed through the input structure AqReadParameters. For the description of the
output data an array of segment descriptors, AqSegmentDescriptor, and a waveform descriptor,
AqDataDescriptor, are returned. These structures are defined in the header file AcqirisDataTypes.h.
The following parameter setting can be used for reading a single waveform segment in 8-bit representation.
static long nbrSegments = 1; // readMode = 0 requires this value
const long nbrPoints = 1000;
char dataArray[nbrPoints+32];
AqReadParameters *readPar = new AqReadParameters;
AqDataDescriptor *dataDesc = new AqDataDescriptor;
AqSegmentDescriptor *segDesc = new AqSegmentDescriptor[nbrSegments];
readPar->dataType = 0; // 0 = byte
readPar->readMode = 0; // 0 = standard waveform
readPar->nbrSegments = nbrSegments;
readPar->firstSampleInSeg = 0;
readPar->segmentOffset = 0; // unused parameter
readPar->firstSegment = 0;
readPar->nbrSamplesInSeg = nbrPoints;
readPar->dataArraySize = sizeof(dataArray);
readPar->segDescArraySize = sizeof(AqSegmentDescriptor)*nbrSegments;
readPar->flags = 0;
readPar->reserved = 0;
readPar->reserved2 = 0.0;
readPar->reserved3 = 0.0;
status = AcqrsD1_readData(instrID, channel, readPar, dataArray ,
dataDesc, segDesc);
Comments:
• The segment numbers run from 0 to nbrSegments-1.