# ReadCJCChannels()

Reads CJC temperature data from a binary file, and stores the values in an array.

Member of the DataLogger class.

## Function Prototype

VB .NET

Public Function ReadCJCChannels(ByVal startSample As Integer, ByVal count Integer, ByRef cjcChannels As Single) As MccDaq.ErrorInfo

C# .NET

public MccDaq.ErrorInfo ReadCJCChannels(int startSample, int count, ref float [] cjcChannels)

## Parameter

startSample

The first sample to read from the binary file.

count

The number of samples to read from the binary file.

cjcChannels

Receives the CJC temperature values.

## Returns

- An ErrorInfo object that indicates the status of the operation.
- cjcChannels – Returns the CJC temperature values logged in the file.

## Notes

- The unit of the CJC temperature data that is returned is set by the value of the units preference. Refer to SetPreferences().
- The units preference is only valid if the logged data is temperature data. This value is ignored if the data logged is raw.

### CJC array

The user is responsible for allocating the size of the CJC array, and ensuring that it is large enough to hold the data that will be returned. You can calculate the array allocation using the sampleCount value from GetSampleInfo(), and the cjcCount value from GetCJCInfo():

float* cjcChannels = new float[sampleCount * cjcCount];

The figure below shows the layout of the CJC array, and how the elements should be indexed.

Where n is (CJCCount - 1)

Use the following code fragment to access the elements of the CJC array:

for (i=0; i<numberOfSamples; i++)

{

for (j=0; j<numberOfCJCChannels; j++)

{

c = cjcArray[(i * numberOfCJCChannels) + j];

}

}

where

numberOfSamples is set by the sampleCount value from GetSampleInfo().

numberOfCJCChannels is set by the cjcCount value from GetCJCInfo().