beautypg.com

Tbksetclk, Tbkseterrhandler – Measurement Computing TempBook rev.3.0 User Manual

Page 80

background image

9-20 tbkCommand Reference (Standard API)

TempBook User’s Manual

tbkSetClk

DLL Function

int tbkSetClk(uint ctr1, uint ctr2);

C

tbkSetClk(unsigned ctr1, unsigned ctr2);

QuickBASIC

BtbkSetClk% (ByVal ctr1%, ByVal ctr2%)

Visual Basic

VBtbkSetClk% (ctr1%, ctr2%)

Turbo Pascal

tbkSetClk( ctr1:word; ctr2:word ):integer;

Parameters

uint ctr1

The value of the counter 1 divisor
Valid values: 0 - 65535

uint ctr2

The value of the counter 2 divisor
Valid values: 0 - 65535

Returns

TerrInvClock

- Invalid clock

TerrNoError

- No error

See Also

tbkSetFreq, tbkGetFreq

Program References

tbkSetClk

sets the frequency of the pacer clock using the two specified counter values. The

pacer clock can be used to control the sampling rate of the A/D converter. The frequency is defined
to be xtal/ctr1*ctr2) where xtal is the frequency of the board crystal (either 1 MHz or 100 kHz).

tbkSetErrHandler

DLL Function

tbkSetErrHandler(tbkSetErrHandlerFTP tbkErrorHandler);

C

tbkSetErrHandler(tbkErrorHandlerFPT tbkErrorHandler);

QuickBASIC

BtbkSetErrHandler% (ByVal tbkErrorHandler&)

Visual Basic

VBtbkSetErrHandler% (tbkErrorHandler%)

Turbo Pascal

tbkSetErrHandler( tbkErrorHandler:ErrorFuncT ):integer;

Parameters

tbkErrHandler

This is a function that takes an integer (error code) and returns nothing, or NULL to disable.

Returns

TerrNoError

- No error, or an error number

See Also

tbkDefaultHandler

Program References

*** For C and Pascal Only - If the driver detects an error condition during its operation, it

automatically calls a default system error handler. This command allows the user to supply an
error handler that is automatically called when a system error is detected.

*** For Visual Basic and QuickBASIC - If the driver detects an error condition during its operation,

it will pass the error code as the return value of each function. This command allows the user to
set a BASIC error number which will be generated when an error occurs. The error can then be
handled using the standard ONERROR feature of BASIC.