Daqadctransfersetbuffer – Measurement Computing TempBook rev.3.0 User Manual
Page 142

11-18 daqCommand Reference (Enhanced API)
TempBook User’s Manual
daqAdcTransferSetBuffer
DLL Function
DaqAdcTransferSetBuffer(DaqHandleT handle, PWORD buf, DWORD scanCount, DWORD
transferMask);
C
DaqAdcTransferSetBuffer(DaqHandleT handle, PWORD buf, DWORD scanCount, DWORD
transferMask);
Visual BASIC
VBdaqAdcTransferSetBufferAllocMem&(ByVal handle&, ByVal scanCount&, ByVal
transferMask&)
Delphi
daqAdcTransferSetBufferAllocMem(handle:DaqHandleT; scanCount:DWORD;
transferMask:DWORD)
Parameters
handle
Handle to the device for which an ADC transfer is to be performed.
buf
Pointer to the buffer for which the acquired data is to be placed.
scanCount
The total length of the buffer (in scans).
transferMask
Configures the buffer transfer mode.
Returns
DerrNoError
- No error (also, refer to API Error Codes on page 11-39)
See Also
daqAdcTransferStart, daqAdcTransferStop, daqAdcTransferGetStat, daqAdcSetAcq,
daqAdcTransferBufData
Program References
ADCEX1.C, DACEX1.C, DYN32ENH.C, DAQEX.FRM (VB), ADCEX.PAS (Delphi), ADCEX9.C, ADCEX10.C
Used With
All devices
daqAdcTransferSetBuffer
allows you to configure transfer buffers for ADC data
acquisition. This function can be used to configure the specified user- or driver-allocated buffers for
subsequent ADC transfers.
If a user-allocated buffer is to be used, two conditions apply:
•
The buffer specified by the buf parameter must have already been allocated by the user
prior to calling this function.
•
The allocated buffer must be large enough to hold the number of ADC scans as determined
by the current ADC scan group configuration.
The scanCount parameter is the total length of the transfer buffer in scans. The scan size is
determined by the current scan group configuration. Refer to the daqAdcSetScan and
daqAdcSetMux
functions for further information on scan group configuration.
The character of the transfer can be configured via the transferMask parameter. Among other
things, the transferMask specifies the update, layout/usage, and allocation modes of the buffer.
The modes can be set as follows:
•
DatmCycleOn
- Specifies the buffer to be a circular buffer in buffer-cycle mode; allows the
transfer to continue when the end of the transfer buffer is reached by wrapping the transfer of
ADC data back to the beginning of the buffer. In this mode, the ADC transfer buffer will
continue to be wrapped until the post-trigger count has been reached (specified by
daqAdcSetAcq
) or the transfer/acquisition is halted by the application
(daqAdcTransferStop, daqAdcDisarm). The default setting is DatmCycleOff.
•
DatmUpdateSingle
- Specifies the update mode as single sample. The update mode can
be set to update for every sample or for every block of ADC data. The update-on-single
setting allows the ADC transfer buffer to be updated for each sample collected by the ADC.
Compared to the block mode, this setting provides a higher degree of real-time transfer-buffer
updating at the expense of slower aggregate-data throughput rates. The default setting is
DatmUpdateBlock.
•
DatmDriverBuf
- Specifies that the driver allocate the ADC acquisition buffer as a circular
buffer whose length is determined by the scanCount parameter with current scan group
configuration. This option allows the driver to manage the circular acquisition buffer rather
than placing the burden of buffer management on the user. This option should be used with
the daqAdcTransferBufData to access the ADC acquisition buffer. The
daqAdcTransferStop
or the daqAdcDisarm function will stop the current transfer and
de-allocate the driver-supplied ADC acquisition buffer. The default setting is
DatmUserBuf
. The DatmUserBuf option specifies a user-allocated ADC acquisition
buffer. Here, buffer management must be done in user code. This option should be used with
the daqAdcTransferStart function to perform the ADC data transfer operation.