User manual

2.3.22 AcqrsD1_accumulateData
Purpose
Returns a waveform as an array and accumulates it in a client array.
Parameters
Input
Name Type Description
instrumentID ViSession Instrument identifier
channel ViInt32 1...Nchan
readPar AqReadParameters Requested parameters for the acquired waveform.
Output
Name Type Description
dataArray ViAddr User-allocated waveform destination array of type char
or byte. Its size in dataType units MUST be at least
'nbrSamples' + 32, for reasons of data alignment.
sumArray ViInt32 [ ] User-allocated waveform accumulation array. Its size
MUST be at least 'nbrSamples'. It is a 32-bit integer
(long) array, with the sample-by-sample sum of the
data values in ADC count unit (LSB). See discussion
below.
dataDesc AqDataDescriptor Waveform descriptor structure.
segDescArray ViAddr Segment descriptor structure.
Return Value
Name Type Description
status ViStatus Refer to Table 2-1 for error codes.
Discussion
This function uses the AcqrsD1_readData routine. However, only 'readPar->nbrSegments = 1' and 'readPar-
>readMode = 0' (ReadModeStdW) are supported. 'readPar->dataType = 3' (real) and 'readPar->dataType =
2' (long) are NOT supported.
The sumArray contains the sample-by-sample sums. To get the average values, the array elements must be
divided by the number of accumulations performed. The sumArray can be interpreted as an unsigned
integer. Alternatively, negative values have to be increased by 2**32.
The number of acquisitions, nbrAcq, can be at most 16777216 for 'readPar->dataType = 0' (char) or 65536
for 'readPar->dataType = 1' (short). This is to avoid an overflow where the summed values will wrap around
0.
The value in Volts of a data point data in the returned dataArray can be computed with the formula:
V = dataDesc.vGain * data – dataDesc.vOffset
Programmer’s Reference Manual Page 42 of 210