Tbkrdtempn – Measurement Computing TempBook rev.3.0 User Manual
Page 76

9-16 tbkCommand Reference (Standard API)
TempBook User’s Manual
tbkRdTempN
DLL Function
tbkRdTempN( uint chan, uchar tcType, uint count, int * temp, uint * buf,
float freq, uint avg )
C
tbkRdTempN( unsigned chan, unsigned tcType, unsigned count, int * temp,
unsigned * buf, float freq, unsigned avg );
QuickBASIC
BtbkRdTempN% (ByVal chan%, ByVal tcType%, ByVal count%, temp%, buf%, ByVal
freq!, ByVal avg%)
Visual Basic
VBtbkRdTempN% (chan%, tcType%, count%, temp%(), buf%(), freq!, avg%)
Turbo Pascal
tbkRdTempN( chan:word; tcType:word; count:word; temp:DataP; buf:WordP;
freq:real; avg:word ):integer;
Parameters
uint chan
Single channel number (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 temperature is 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.
0 - block averaging
1 - no averaging
2 - moving averaging
Returns
TerrInvChan
- Invalid Channel
TerrTCE_Type
- Invalid Thermocouple Type
TerrInvCount
- More than 1 scan specified with freq = 0
See Also
tbkRdTemp, tbkRdTempScan, tbkRdTempScanN, tbkTCSetup, tbkTCConvert,
tbkTCSetupConvert
Program References
TEMPEX1 (all languages)
tbkRdTempN
is used to take multiple thermocouple readings from the given analog input channel.
The readings will be zero corrected, span corrected, and linearized to yield temperature reading(s) 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 4 * count.
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.