beautypg.com

Tbkrdnforepretwait, Tbkrdscan – Measurement Computing TempBook rev.3.0 User Manual

Page 74

background image

9-14 tbkCommand Reference (Standard API)

TempBook User’s Manual

tbkRdNForePreTWait

DLL Function

int tbkRdNForePreTWait(uint *buf, uint count, uint *retcount);

C

tbkRdNForePreTWait(unsigned int _far *buf, unsigned int count, unsigned int
_far *retcount);

QuickBASIC

BtbkRdNForePreTWait% (buf%, ByVal count%, retcount%)

Visual Basic

VBtbkRdNForePreTWait% (buf%(), count%, retcount%)

Turbo Pascal

tbkRdNForePreTWait( buf:WordP; count:word; retcount:WordP):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

uint *retcount

Pointer to an integer representing the number of scans actually taken

Returns

TerrFIFOFull

- Buffer overrun

TerrNoError

- No error

See Also

tbkSetTrigPreT, tbkRdNForePreT, tbkRdNBackPreT

Program References

PRETEX2 (all languages)

tbkRdNForePreTWait

reads multiple A/D scans, initiated by the tbkSetTrigPreT

command, in the foreground. Unlike the tbkRdNForePreT command, this function will not
return until the acquisition completes. It will only return when the specified trigger event has
occurred and the specified post trigger count has been satisfied.

This function may be called subsequent to configuring a pre-trigger acquisition using the
tbkSetTrigPreT

command. Once this command has been called, it will return only when the

trigger has been detected and the acquisition has completed. The amount specified in the ‘count’
parameter specifies the length of the supplied buffer in scans. Unlike tbkAdcRdNForePreT this
command will not return when ‘count’ is satisfied; instead, it will continue acquiring by wrapping
the scans to the beginning of the buffer until the final post-trigger scan is collected and the
acquisition completes.

When the acquisition completes, control will be returned to the application program along with the
actual number of scans collected in the ‘retcount’ parameter.

Note: If the A/D converter has not been configured to acquire data or the trigger event never occurs,
this function may wait indefinitely, hanging the computer.

tbkRdScan

DLL Function

int tbkRdScan(uint startChan, uint endChan, uint *buf, uchar gain);

C

tbkRdScan(unsigned startChan, unsigned endChan, unsigned * buf, unsigned
char gain);

QuickBASIC

BtbkRdScan% (ByVal startChan%, ByVal endChan%, buf%, ByVal gain%)

Visual Basic

VBtbkRdScan% (startChan%, endChan%, buf%(), gain%)

Turbo Pascal

tbkRdScan( startChan:word; endChan:word; buf:WordP; gain:byte ):integer;

Parameters

uint startChan

The starting channel of the scan group (see table at end of chapter for valid values)

uint endChan

The ending channel of the scan group (see table at end of chapter for valid values)

uint *buf

An array where the A/D scans will be placed

unchar gain

The channel gain (see table at end of chapter for valid values)

Returns

TerrInvGain

- Invalid gain

TerrInvChan

- Invalid channel

TerrNoError

- No error

See Also

tbkRd, tbkRdN, tbkRdNScan, tbkSetMux, tbkRdFore, tbkSetClk, tbkSetTrig

Program References

tbkRdScan

reads a single sample from multiple channels. This function will use a software trigger

to immediately trigger and acquire one scan consisting of each channel starting with ‘startChan’ and
ending with ‘endChan’.