Tbkdefaulthandler, Tbkgetbackstat, Tbkgetfreq – Measurement Computing TempBook rev.3.0 User Manual

Page 66

Advertising
background image

9-6 tbkCommand Reference (Standard API)

TempBook User’s Manual

tbkDefaultHandler

DLL Function

int tbkDefaultHandler( uchar tbkErrnum );

C

tbkDefaultHandler( int tbkErrnum );

QuickBASIC

BtbkDefaultHandler% (ByVal tbkErrnum%)

Visual Basic

VBtbkDefaultHandler% (tbkErrnum%)

Turbo Pascal

tbkDefaultHandler( tbkErrnum:integer );

Parameters

tbkErrnum

The error code of the detected error.

Returns

Nothing

See Also

tbkSetErrHandler

Program References

None

tbkDefaultHandler

displays an error message and then exits the application program. When

the TempBook library is loaded, it invokes the default error handler whenever it encounters an error.
The error handler may be changed with tbkSetErrHandler.

tbkGetBackStat

DLL Function

int tbkGetBackStat(uchar *active, ulong *count);

C

tbkGetBackStat(unsigned char _far *active, unsigned long _far *count);

QuickBASIC

BtbkGetBackStat%(active%, count&)

Visual Basic

VBtbkGetBackStat% (active%, count&)

Turbo Pascal

tbkGetBackStat( active:ByteP; count:LongP ):integer;

Parameters

uchar *active

A flag which will be returned non-zero if a background transfer is in progress, or 0 if not

ulong *count

The number of scans acquired by the last or current background transfer

Returns

TerrOverrun

- Internal data buffer overrun

TerrFIFOFull

- ADC FIFO Overrun

TerrNoError

- No error

See Also

tbkRdNBack, tbkStopBack

Program References

None

tbkGetBackStat

determines if a background operation is still in progress. It also reads the

number of bytes acquired by the last or current background operation initiated by the tbkRdNBack
function.

tbkGetBackStat

can return two possible error codes. TerrFIFOFull is returned if the data

FIFO in the TempBook/66 is filled before the user can read the data out. In which case, the data
read may be invalid. If the tbkRdNBack is called with the cycle flag enabled, a TerrOverrun
can be returned. This means that the software is just fast enough to read one buffer of data. If this
error occurs, the amount of data available (specified by 'count') is valid, but the transfer was stopped.

tbkGetFreq

DLL Function

int tbkGetFreq(float *freq);

C

tbkGetFreq(float _far *freq);

QuickBASIC

BtbkGetFreq% (freq!)

Visual Basic

VBtbkGetFreq% (freq!)

Turbo Pascal

tbkGetFreq( freq:FloatP ):integer;

Parameters

float *freq

A variable to hold the currently defined sampling frequency in Hz
Valid values: 100000.0 - 0.0002

Returns

TerrNoError

- No error

See Also

tbkSetFreq, tbkSetClk

Program References

None

tbkGetFreq

reads the sampling frequency of the pacer clock. Note: tbkGetFreq assumes that

the 100 kHz/1 MHz jumper is set to the default position of 1MHz.

Advertising