Read Data from the Built-In CJC Sensor on DAQ Device in LabVIEW

Updated Jul 7, 2022

Environment

Hardware

  • NI-9211
  • NI-9214
  • NI-9219
  • SCB-68
  • SCB-68A
  • SCB-100
  • PXIe-4353
  • NI-9213

I have cold junction compensation (CJC) sensors built into my analog input DAQ device or module like the NI 9214, 9219, or terminal block like the SCB-68, SCB-68A or SCB-100. How do I read the values from these sensors using DAQmx functions in LabVIEW?

The LabVIEW code to read from a built-in CJC sensor(s) will differ depending on whether you are:
  • Acquiring only from the CJC sensor(s).
  • Acquiring from CJC sensor(s) while simultaneously acquiring from the analog input channels.


Reading CJC Values Only



Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW block diagram.

DAQmx Physical Channel Constant
  1.  Right-Click » I/O Name Filtering
  2.  Make sure Internal Channels is checked
  3. The CJC channels will now be displayed in the drop-down (e.g. _cjtemp0, _cjtemp1).

DAQmx Create Virtual Channel
Drop-Down Menu Analog Input » More » AI Temp Built-In Sensor


Reading CJC Values and Analog Input Values Simultaneously 


By default, DAQmx Read does not return data from cold-junction compensation channels. As a result, you may encounter Error -200072 when trying to read from the CJC sensors using DAQmx Create Virtual Channel as shown above. This occurs due to a conflict in the access of the CJC sensors, since the CJC sensors are also accessed in the AI Temp TC operation.

Instead, the Force Read from Channel Property Node is recommended. It forces read operations to return CJC data with the other channel data when set to TRUE.

ReadFromCJC.png
Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW block diagram.


DAQmx Create Virtual Channel
Drop-Down Menu Analog Input » Temperature » Thermocouple

DAQmx Physical Channel Constant
  1. Right-Click » I/O Name Filtering
  2. Make sure Internal Channels is checked
  3. The CJC channels will now be displayed in the drop-down (e.g. _cjtemp0, _cjtemp1).

DAQmx Channel Property Node
  1. Right-Click » Select Filter » Show All Attributes
  2. Set property to Active Channels (if subset).
  3. Expand Property Node and set second property to Analog Input » Temperature » Advanced » Force Read from Channel.
  4. Wire in values as shown in snippet above.