beautypg.com

Tbkrdfore, Tbkrdn – Measurement Computing TempBook rev.3.0 User Manual

Page 70

background image

9-10 tbkCommand Reference (Standard API)

TempBook User’s Manual

tbkRdFore

DLL Function

int tbkRdFore(uint *sample);

C

tbkRdFore(unsigned _far *sample);

QuickBASIC

BtbkRdFore% (sample%)

Visual Basic

VBtbkRdFore% (sample%)

Turbo Pascal

tbkRdFore( sample:WordP ):integer;

Parameters

uint *sample

A pointer to a value where an A/D sample is stored
Valid values: (See

tbkSetTag

)

Returns

TerrFIFOFull

- Buffer overrun

TerrNoError

- No error

See Also

tbkReadFIFO, tbkSetTag, tbkSetClk, tbkSetTrig, tbkSetScan

Program References

None

tbkRdFore

will read one sample from the A/D data FIFO. This function, unlike the tbkRd

function, will not configure the trigger source. It 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.

tbkRdN

DLL Function

int tbkRdN(uint chan, uint *buf, uint count, uchar trigger, uchar oneShot,
float freq, uchar gain);

C

tbkRdN(unsigned chan, unsigned *buf, unsigned count, unsigned char trigger,
unsigned char oneShot, float freq, unsigned char gain);

QuickBASIC

BtbkRdN% (ByVal chan%, buf%, ByVal count%, ByVal trigger%, ByVal oneShot%,
ByVal freq!, ByVal gain%)

Visual Basic

VBtbkRdN% (chan%, buf%(), count%, trigger%, oneShot%, freq!, gain%)

Turbo Pascal

tbkRdN( chan:word; buf:WordP; count:word; trigger:byte; oneShot:byte;
freq:real; gain:byte ):integer;

Parameters

unit chan

A single channel number (see table at end of chapter for valid values)

uint *buf

An array where the A/D scans will be returned

uint count

The number of scans to be taken
Valid values: 1 - 32767

uchar trigger

The trigger source (see table at end of chapter for valid values)

uchar one shot

A flag that if non-zero enables one-shot trigger mode, otherwise enables continuous mode.

float freq

The sampling frequency in Hz (100000.0 to 0.0002)

uchar gain

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

Returns

TerrFIFOFull

- Buffer overrun

TerrInvGain

- Invalid gain

TerrIncChan

- Invalid channel

TerrInvTrigSource

- Invalid trigger

TerrInvLevel

- Invalid level

See Also

tbkRd, tbkRdScan, tbkRdScanN, tbkRdNFore, tbkSetFreq, tbkSetMux, tbkSetClk,
tbkSetTrig

Program References

None

tbkRdN

is used to take multiple scans from a single A/D channel. This function will configure the

pacer clock, arm the trigger and acquire ‘count’ scans from the specified A/D channel.