To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This example program takes analog input from one or more thermocouple channels and performs waveform thresholding to switch a relay when the threshold is crossed.
Description
The program consists of two DAQmx tasks: an analog input and a digital output task. The thermocouple channels are read and passed into a for loop to apply thresholding on each channel. This generates an array of Booleans indicating whether or not a user specified threshold has been crossed. If the threshold has been crossed in any channel, a case structure is used to write to a digital line, triggering the relay.
Requirements
Software
Hardware
This program was tested using an NI cDAQ-9178 chassis, an NI 9211 thermocouple module, a K type thermocouple, and an NI 9481 relay module.
Steps to Implement or Execute Code
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.