# GetTCValues()

Converts raw thermocouple data from a Windows global memory buffer collected using the DaqInScan() method to a one-dimensional or two dimensional array of data on a temperature scale (Celsius, Fahrenheit or Kelvin).

Member of the MccBoard class.

## Function Prototype

VB .NET

Public Function GetTCValues(ByVal chanArray As Short(), ByVal chanTypeArray As MccDaq.ChannelType, ByVal chanCount As Integer, ByVal memHandle As IntPtr, ByVal firstPoint As Integer, ByVal count As Integer, ByVal scale As MccDaq.TempScale, ByVal tempValArray As Single()) As MccDaq.ErrorInfo

Public Function GetTCValues(ByVal chanArray As Short(),ByVal chanTypeArray As MccDaq.ChannelType(), ByVal chanCount As Integer, ByVal memHandle As IntPtr, ByVal firstPoint As Integer, ByVal count As Integer, ByVal scale As MccDaq.TempScale, ByRef tempValArray As Double(,)) As MccDaq.ErrorInfo

C# .NET

public MccDaq.ErrorInfo GetTCValues(short[] chanArray, MccDaq.ChannelType[] chanTypeArray, int chanCount, IntPtr memHandle, int firstPoint, int count, TempScale scale, float[] tempValArray)

public MccDaq.ErrorInfo GetTCValues(short[] chanArray, MccDaq.ChannelType[] chanTypeArray, int chanCount, IntPtr memHandle, int firstPoint, int count, TempScale scale, double[,] tempValArray)

##### Deprecated methods

The following methods are deprecated, and should only be used for legacy applications. The methods above are preferred, and must be used for 64-bit application development.

VB .NET

Copies data to a one-dimensional array of single values:

Public Function GetTCValues(ByVal chanArray As Short(), ByVal chanTypeArray As MccDaq.ChannelType, ByVal chanCount As Integer, ByVal memHandle As Integer, ByVal firstPoint As Integer, ByVal count As Integer, ByVal scale As MccDaq.TempScale, ByRef tempValArray As Single) As MccDaq.ErrorInfo

Copies data to a two-dimensional array of double values:

Public Function GetTCValues(ByVal chanArray As Short(),ByVal chanTypeArray As MccDaq.ChannelType(), ByVal chanCount As Integer, ByVal memHandle As Integer, ByVal firstPoint As Integer, ByVal count As Integer, ByVal scale As MccDaq.TempScale, ByRef tempValArray As Double(,)) As MccDaq.ErrorInfo

C# .NET

Copies data to a one-dimensional array of single values:

public MccDaq.ErrorInfo GetTCValues(short[] chanArray, MccDaq.ChannelType chanTypeArray, int chanCount, int memHandle, int firstPoint, int count, MccDaq.TempScale scale, out float tempValArray)

Copies data to a two-dimensional array of double values:

public MccDaq.ErrorInfo GetTCValues(short[] chanArray, MccDaq.ChannelType() chanTypeArray, int chanCount, int memHandle, int firstPoint, int count, MccDaq.TempScale scale, out double[,] tempValArray)

## Parameters

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 DaqInScan() method.

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 DaqInScan() method.

chanCount

Number of elements in chanArray.

memHandle

The memory handle that was returned (by WinBufAlloc(), WinBufAlloc32(), or WinBufAlloc64()) 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 MccDaq.TempScale.Celsius, MccDaq.TempScale.Fahrenheit, or MccDaq.TempScale.Kelvin.

tempValArray

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

- An ErrorInfo object that indicates the status of the operation.
- tempValArray – Converted data.