Tbkrdnbackpret, Tbkrdnfore – Measurement Computing TempBook rev.3.0 User Manual
Page 72

9-12 tbkCommand Reference (Standard API)
TempBook User’s Manual
tbkRdNBackPreT
DLL Function
int tbkRdNBackPreT(uint *buf, uint count, uchar cycle);
C
tbkRdNBackPreT(unsigned int _far *buf, unsigned int count, unsigned char
cycle);
QuickBASIC
BtbkRdNBackPreT% (buf%, ByVal count%, ByVal cycle%)
Visual Basic
VBtbkRdNBackPreT% (buf%(), count%, cycle%)
Turbo Pascal
tbkRdNBackPreT(buf:WordP; count:word; cycle:byte):integer;
Parameters
uint *buf
An array where the A/D scans will be placed.
uint count
The number of scans to be taken (1-32767)
uchar cycle
A flag that if non-zero will enable continuous operation, or if 0 will disable it
Returns
TerrMultBackXfer
- Background read already in progress
TerrNoError
- No error
See Also
tbkGetBackStat, tbkBackStop, tbkSetTag, tbkSetTrigPreT
Program References
PRETEX3 (all languages)
tbkRdNBackPreT
reads multiple A/D scans, initiated by the tbkSetTrigPreT command, in
the background. This function will return control to the user's program after initiating the
background transfer. The user can then monitor the status of the background transfer with the
tbkGetBackStat
function or stop the transfer with the tbkBackStop function. Because the
transfer occurs in the background, the user can perform other tasks in the foreground. This function
assumes that the pre-trigger acquisition has already been setup using the tbkSetTrigPreT
command.
If the 'cycle' flag is true, the background transfer will run continuously looping back to the beginning
of 'buf' after 'count' scans have been read. Under this mode, the background transfer will continue
until the acquisition completes. This allows the user to collect large amounts of data without calling
tbkRdNBackPreT
several times. As long as the user monitors how much data is in the buffer and
processes the data before it gets overwritten, the background transfer can run until the acquisition
completes. In this mode, the user should get the total number of scans written into 'buf' using the
tbkGetBackStat
function and keep track of the total number of scans processed in a variable.
The difference between these two totals is the number of unprocessed valid scans in 'buf' that the
user can process.
If, however, the 'cycle' flag is false, the background transfer will only collect the number of scans
specified in 'count'. If this is the case, a number of tbkRdNBack calls may be necessary to read all
the data collected during the pre-trigger mode acquisition.
tbkRdNFore
DLL Function
int tbkRdNFore(uint *buf, uint count);
C
tbkRdNFore(unsigned _far *buf, unsigned count);
QuickBASIC
BtbkRdNFore% (buf%, ByVal count%)
Visual Basic
VBtbkRdNFore% (buf%(), count%)
Turbo Pascal
tbkRdNFore( buf:WordP; count:word ):integer;
Parameters
uint *buf
An array where the A/D samples will be placed
uint count
The number of scans to be taken
Valid values: 1 - 32767
Returns
TerrFIFOFull
- Buffer overrun
TerrNoError
- No error
See Also
tbkSetClk, tbkSetTrig
Program References
tbkRdNFore
reads multiple A/D scans in the foreground. Unlike tbkRdNBack, this function
does not use interrupts and does not return control immediately to the program. It will return only
when ‘count’ scans have been read. This function will not configure the A/D acquisition and
assumes that the A/D converter has already been configured to acquire data.
Note: If the A/D converter has not been configured to acquire data, this function may wait
indefinitely, hanging the computer.