beautypg.com

Daqadctransfersetbuffer – Measurement Computing Personal Daq rev.6.0 User Manual

Page 149

background image

Personal Daq User’s Manual

Appendix B,

887095

API Commands B-17


daqAdcTransferSetBuffer

DLL Function

daqAdcTransferSetBuffer(DaqHandleT handle, PVOID buf, DWORD scanCount,
DWORD transferMask);

C

daqAdcTransferSetBuffer(DaqHandleT handle, PVOID buf, DWORD scanCount,
DWORD transferMask);

Visual BASIC

VBdaqAdcTransferSetBufferSingle&(ByVal handle&, buf!(), ByVal ScanCount&, ByVal

transferMask&)

Delphi

daqAdcTransferSetBuffer( handle:DaqHandleT; buf:pointer; scanCount:DWORD;

transferMask:DWORD )

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).

Parameters

transferMask

Configures the buffer transfer mode.

Returns

DerrNoError

No error

See Also

daqAdcTransferStart, daqAdcTransferStop, daqAdcTransferGetStat, daqAdcSetAcq,

daqAdcTransferBufData

Program References

ADCEX1.C, FREQEX1.C, PULSEEX1.C, MULTEX1.C, DAQEX.FRM (VB), DAQEX.PAS (Delphi)

Used With

All devices

Description

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 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 scan data back to the beginning of the buffer. In this mode, the 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 data. The update-on-single setting allows the transfer buffer to be updated for each sample collected by the
Personal Daq. The default setting is DatmUpdateSingle.

DatmSavePreTrigBuf

- Specifies that the driver save the pre-trigger data once the trigger event has been satisfied. This option

allows the driver to save pre-trigger data in a separate linear buffer once the trigger event has occurred. By doing so the pre-
trigger data buffer can be accessed at any time after the trigger event without having the possibility of the pre-trigger data being
overwritten by new data being written to the driver buffer. When the trigger event occurs the driver writes the specified amount
(daqAdcSetMode) of pre-trigger data to an internal pre-trigger buffer which the driver allocates. The pre-trigger data may then be
accessed via the daqAdcTransferBufData function. This option must be used in conjunction with the DatmDriverBuf option.

DatmDriverBuf

- Specifies that the driver allocate the 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 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 acquisition buffer. Here, buffer management must be done in user code. This

option should be used with the daqAdcTransferStart function to perform the data transfer operation.

This manual is related to the following products: