Example Code

Trigger Temperature Alarm with Temperature Data from DAQmx Device

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 program uses the DAQmx driver to read data from a DAQ device gathering temperature data, and then programmatically changing the color of a thermometer depending on an alarm level set by the user.

Description:
The purpose of this program is to collect temperature data from a DAQ device, plot the temperature on a chart, and then show the temperature in a thermometer. The fill color of that thermometer is programmatically determined by the temperature that is currently being read by the DAQ device. The user will determine the "alarm level" or the temperature level at which they want the color to change on the thermometer indicating that the temperature data has passed that user defined threshold.

Steps to implement or execute code
To implement this example:

  1. Define the Physical channels to be used
  2. Configure the alarm level
  3. Run the VI
  4. (Optional) Turn on the Highlight Execution to see the flow of the VI

 

To execute this example:

  1. Install the required software.
  2. Connect the DAQ hardware that supports Analog Input features
  3. Confirm the connection with the MAX with TestPanel
  4. Open the VI and refer the Implement Steps


Requirements
Software
LabVIEW 2012 or compatible
NI-DAQmx 16.0 or compatible

Hardware
cDAQ with C series Analog Input Module

 

fp.JPG

 

bd.JPG

 

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

Stephanie S.
Application Engineer
National Instruments

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