Example Code

Thermocouple Threshold Triggered Relay Operation with DAQmx

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Hardware

  • Data Acquisition (DAQ)

    Software

  • LabVIEW

    Driver

  • NI DAQmx

Code and Documents

Attachment

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

  • LabVIEW 2011 or compatible
  • DAQmx 9.3.5 or compatible

Hardware

  • DAQmx compatible thermocouple
  • Digital output controlled relay

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

  1. Open the attached VI.
  2. Select the proper physical channels for your thermocouples and relay.
  3. Specify the sampling parameters and thermocouple type.
  4. Specify the temperature threshold
  5. Run the program.

**This document has been updated to meet the current required format for the NI Code Exchange.**

Rob B
FlexRIO Product Manager

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors