beautypg.com

Tbkrdbit, Tbkrdbyte, Tbkrdcntr0 – Measurement Computing TempBook rev.3.0 User Manual

Page 69

background image

TempBook User’s Manual

tbkCommand Reference (Standard API) 9-9

tbkRdBit

DLL Function

int tbkRdBit(uchar bitNum, uchar *bitVal);

C

tbkRdBit(unsigned char bitNum, unsigned char *bitVal);

QuickBASIC

BtbkRdBit% (ByVal bitNum%, bitVal%)

Visual Basic

VBtbkRdBit% (bitNum%, bitVal%)

Turbo Pascal

tbkRdBit( bitNum:byte; bitVal:ByteP ):integer;

Parameters

uchar bitNum

The bit number of the specified digital I/O port to read
Valid values: 0 - 7

uchar *bitVal

A variable to hold the value of the specified bit (non-zero if asserted, 0 if unasserted)

Returns

TerrInvBitNum

- Invalid bit number

TerrNoError

- No error

See Also

tbkWtByte, tbkRdByte, tbkWtBit

Program References

None

tbkRdBit

reads the state of a single digital input bit.

tbkRdByte

DLL Function

int tbkRdByte(uchar *byteVal);

C

tbkRdByte(unsigned char *byteVal);

QuickBASIC

BtbkRdByte%(digIn%)

Visual Basic

VBtbkRdByte% (digIn%)

Turbo Pascal

tbkRdByte( byteVal:DataP ):integer;

Parameters

uchar *byteVal

A variable to hold the value of the digital input byte

Returns

TerrNoError

- No error

See Also

tbkWtByte, tbkWtBit, tbkRdBit

Program References

None

tbkRdByte

reads the 8-bit digital input byte.

tbkRdCntr0

DLL Function

int tbkRdCntr0(uint *cntr0, uchar latch);

C

tbkRdCntr0(unsigned _far *cntr0, unsigned char mode);

QuickBASIC

BtbkRdCntr0% (cntr0%, ByVal latch%)

Visual Basic

VBtbkRdCntr0% (cntr0%, latch%)

Turbo Pascal

tbkRdCntr0( cntr0:WordP; mode:Byte ):integer;

Parameters

uint *cntr0

The value read back from the Counter 0 hold register
Valid values: 0 - 65535

uchar latch

If latch is non-zero, the count register will be latched into the hold register before reading.
If latch is zero, the count register will be read directly.
Direct reading should only be performed when no clock pulses are present.

Returns

TerrNoError

- No error

See Also

tbkConfCntr0, tbkWtCntr0

Program References

None

tbkRdCntr0

reads the hold register of counter 0. This function is normally used with mode 0 of

counter 0 (see tbkConfCntr0) to read the current count value.