beautypg.com

Prototypes, Program references, Typical transfer buffer settings – Measurement Computing Data Acquisition Systems rev.10.4 User Manual

Page 121: Visual basic

background image


where mod is defined as the integer remainder of performing an integer divide of retCount by scanCount.
Detection of a buffer overrun condition is the responsibility of the application.
If using a linear buffer (DatmCycleOff) and the acquisition is expected to continue past the end of the
allocated buffer size, a new buffer must be allocated and configured using this function in a timely manner to
avoid loss of data (as would be the case in an alternating or “ping-pong” buffer approach).

Typical Transfer Buffer Settings

The following table shows a set of are typical transfer buffer settings; it assumes scan group size of 4 channels
and sample size of 2 bytes.

Desired Buffer

buf scanCount

transferMask

Application allocated linear buffer of 50,000
scans updated on every sample

App pointer to memory
(size = 50,000 x 4 x 2
= 400,000 bytes)

50,000 DatmCycleOff

+

DatmUpdateSingle +
DatmUserBuf

Application allocated linear buffer of 100,000
scans updated by block

App pointer to memory
(size = 100,000 x 4 x 2
= 800,000 bytes)

100,000 DatmCycleOff

+

DatmUpdateBlock +
DatmUserBuf

Application allocated circular buffer of 40,000
scans updated on every sample

App pointer to memory
(size = 40000 x 4 x 2
= 320,000 bytes)

40,000 DatmCycleOn

+

DatmUpdateSingle +
DatmUserBuf

Application allocated circular buffer of 200,000
scans updated by block

App pointer to memory
(size = 200,000 x 4 x 2
= 1,600,000 bytes)

200,000 DatmCycleOn

+

DatmUpdateBlock +
DatmUserBuf

Driver allocated circular buffer of 40,000 scans
updated on every sample

NULL (Driver allocates
= 40,000 x 4 x 2
= 320,000 bytes)

40,000 DatmUpdateSingle

+

DatmDriverBuf

Driver allocated circular buffer of 200,000 scans
updated by block

NULL (Driver allocates
= 200,000 x 4 x 2
= 1,600,000 bytes)

200,000 DatmUpdateBlock

+

DatmDriverBuf

Prototypes

C/C++

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

Visual BASIC

VBdaqAdcTransferSetBuffer&(ByVal handle&, buf%, ByVal scanCount&, ByVal
transferMask&)

Program References

DAQADCEXO1.CPP, DAQADCEX02.CPP, DAQADCEX03.CPP, DAQADCEX05.CPP,
DAQADCEX07.CPP, DBK04EX.CPP, DBK07EX.CPP, DBK08EX.CPP, DBK09EX.CPP,
DBK12_13EX.CPP, DBK15EX.CPP, DBK16EX.CPP, DBK17EX.CPP, DBK18EX.CPP,
DBK19EX.CPP, DBK42EX.CPP, DBK43EX.CPP, DBK44EX.CPP, DBK45EX.CPP,
DBK50EX.CPP, DBK51EX.CPP, DBK52EX.CPP, DBK53_54EX.CPP, DAQEX.FRM (VB)

Programmer’s Manual

908594

Daq API Command Reference 4.2-65