beautypg.com

High-level thermocouple measurement functions, Single-channel measurement (tbkrdtemp) – Measurement Computing TempBook rev.3.0 User Manual

Page 59

background image

TempBook User’s Manual

Thermocouple Measurement 8-3

Scan

Readings from Channel

Results from Channel

0

1

0

1

1

1A

2A

1A

2A

2

1B

2B

(1A+1B)/2

(2A+2B)/2

3

1C

2C

(1A+1B+1C)/3

(2A+2B+2C)/3

4

1D

2D

(1B+1C+1D)/3

(2B+2C+2D)/3

5

1E

2E

(1C+1D+1E)/3

(2C+2D+2E)/3

6

1F

2F

(1D+1E+1F)/3

(2D+2E+2F)/3

The conversion function is tbkTCConvert: (Note: Further details in Command Reference chapter.)

tbkTCConvert( uint *counts, uint scans, int *temp, uint ntemp)

uint *counts

A array of one or more scans of raw data as received from the TempBook. The ADC

data bits are in the 12 most significant bits of the 16-bit integers.

Valid range: Each raw data item may be any 16-bit value.

uint scans

The number of scans of data in counts.
Valid range: 1 to 32768/nscan (counts is limited to 64 Kbytes)

int *temp

The converted temperature results. The integer values are 10 times the temperatures

in degrees C; e.g., 50°C would be represented as 500 and -10°C would be -100.

Valid range: Results range from -2000 (-200°C) to +13720 (+1372°C) depending on the

thermocouple type.

uint ntemp

The number of entries in the temp array. This is checked by the functions to avoid

writing past the end of the temp array.

Valid range: If avg is 0, then ntc or greater.
If avg is non-zero, then scans * ntc or greater.

For convenience both setup and conversion can be performed at once by tbkTCSetupConvert: (Note:
Further details in Command Reference chapter.)

tbkTCSetupConvert(uint nscan, uint cjcPosition, uint ntc, uint tcType, uchar
bipolar, uint avg, uint *counts, uint scans, int *temp, uint ntemp)

The auto-zero feature can be enabled disabled using the tbkTCAutoZero function: (Note: Further details
in Command Reference chapter.)

tbkTCAutoZero (uint zero)

uint zero

Non-zero to enable auto-zeroing;
zero (0) to disable auto-zeroing.

Note: see the tempex2 example programs in the individual language support chapters fore examples of
using these functions.

High-Level Thermocouple Measurement Functions

The high-level thermocouple measurement functions are designed to provide combined scan sequencer
setup, triggering, data collection, and linearization. There are 4 functions in this group:

tbkRdTemp

Read a single thermocouple channel once.

tbkRdTempN

Read a single thermocouple channel multiple times.

tbkRdTempScan

Read a range of thermocouple channels once.

tbkRdTempScanN

Read a range of thermocouple channels multiple times.

Note: see tempex1 sample programs using these functions in the individual language-support chapters.

Single-Channel Measurement (tbkRdTemp)

The tbkRdTemp function uses software triggering to immediately acquire one sample from the specified
analog input channel. This function also collects CJC and shorted channel readings for linearization and
zero compensation. The CJC and thermocouple readings are then zero compensated and the thermocouple
reading is linearized. The converted temperature is placed in a variable supplied by the calling program.
(Note: Further details in Command Reference chapter.)

tbkRdTemp (uint chan, uint tcType, int *temp)

uint chan

The channel number to which the thermocouple is attached.

uint tcType

The type of thermocouple attached.

int*temp

A variable in which to store the measured temperature