beautypg.com

Tbkrdtempscann – Measurement Computing TempBook rev.3.0 User Manual

Page 78

background image

9-18 tbkCommand Reference (Standard API)

TempBook User’s Manual

tbkRdTempScanN

DLL Function

tbkRdTempScanN(uint startChan, uint endChan, uchar tcType, uint count, int *
temp, uint * buf, float freq, uint avg)

C

tbkRdTempScanN(unsigned startChan, unsigned endChan, unsigned tcType,
unsigned count, int * temp, unsigned * buf, float freq, unsigned avg);

QuickBASIC

BtbkRdTempScanN% (ByVal startChan%, ByVal endChan%, ByVal tcType%, ByVal
count%, temp%, buf%, ByVal freq!, ByVal avg%)

Visual Basic

VBtbkRdTempScanN% (startChan%, endChan%, tcType%, count%, temp%(), buf%(),
freq!, avg%)

Turbo Pascal

tbkRdTempScanN( startChan:word; endChan:word; tcType:word; count:word;
temp:DataP; buf:WordP; freq:real; avg:word ):integer;

Parameters

uint startchan

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

uint endChan

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

uint tcType

Thermocouple type (see table at end of chapter for valid values)

uint count

Number of scans to read.

int *temp

Pointer to a value where the converted temperatures are to be stored

uint *buf

Pointer to an array where the raw ADC counts are to be stored.

float freq

Sampling frequency in Hz
Valid values: 100000.0 - 0.0002

uint avg

Type of averaging to be used.

Returns

TerrInvChan

- Invalid Channel

TerrTCE_Type

- Invalid Thermocouple Type

TerrInvCount

- More than 1 scan specified with freq = 0

See Also

tbkRdTemp, tbkRdTempN, tbkRdTempScan, tbkTCSetup, tbkTCConvert,
tbkTCSetupConvert

Program References

TEMPEX1 (all languages)

tbkRdTempScanN

is used to take multiple thermocouple readings from analog input channels

‘startChan’ through ‘endChan’. The readings will be zero-corrected, span-corrected, and linearized
to yield temperature readings in tenths of a degree Celsius. This function will use pacer-clock
triggering to acquire samples at the rate defined in the parameter freq. The parameter avg is used
to specify no, block, or moving averaging.

A pointer to a buffer array must be provided for storage of the raw ADC counts. The array
dimension must be at least count * (endChan - startChan + 4).

If a calibration constant file with the default name “tempbook.cal” is not visible to the calling
program, then no span correction is performed.

tbkSetMode

must be called before this function to configure the TempBook for differential

operation in either unipolar or bipolar mode.