# cbGetTCValues()

Converts raw thermocouple data collected using the cbDaqInScan() function to data on a temperature scale (Celsius, Fahrenheit, or Kelvin).

## Function Prototype

C/C++

int cbGetTCValues(int BoardNum, short *ChanArray, short *ChanTypeArray, int ChanCount, int MemHandle, int FirstPoint, long Count, int Scale, float *TempValArray)

Visual Basic

Function cbGetTCValues (ByVal BoardNum&, ChanArray%, ChanTypeArray%, ByVal ChanCount&, ByVal MemHandle&, ByVal FirstPoint&, ByVal Count&, ByVal CBScale&, TempValArray!) As Long

## Arguments

BoardNum

The board number used to collect the data. BoardNum may be 0 to 99. Refers to the number associated with the board used to collect the data when it was installed with InstaCal. The specified board must support synchronous input.

ChanArray

Array containing channel values. Valid channel values are analog and temperature input channels and digital ports. ChanArray must match the channel array used with the cbDaqInScan() function.

ChanTypeArray

Array containing channel types. Each element of this array defines the type of the corresponding element in the ChanArray. ChanTypeArray must match the channel type settings used with the cbDaqInScan() function

ChanCount

Number of elements in ChanArray.

MemHandle

This must be a memory handle that was returned by cbWinBufAlloc() when the buffer was allocated. The buffer should contain the data that you want to convert.

FirstPoint

The index into the raw data memory buffer that holds the first sample of the first channel to be converted. The index into the raw memory is (FirstPoint x ChanCount) so that converted data always starts with the first channel specified in the scan. For example, if FirstPoint is 14 and the number of channels is 8, the index of the first converted sample is 112.

Count

The number of samples per channel to convert to engineering units. Count should not exceed Windows buffer size / ChanCount – FirstPoint.

Scale

Specifies the temperature scale that the input will be converted to. Choices are CELSIUS, FAHRENHEIT and KELVIN.

TempArray

The array to hold the converted data. This array must be allocated by the user, and must be large enough to hold count samples x the number of temperature channels.

## Returns

- Error code or 0 if no errors
- TempValArray – Converted data.