From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

DAQmx Device Temperature Monitoring with TDMS Logging

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 works to continually monitor the onboard temperature sensors on the PXI devices in your system..

 

Description

The purpose of this example is to continually monitor the onboard temperature sensors on the PXI devices in your system.  This Example will read the onboard sensors from supported devices every 10 seconds and log the result to a file.   This example can also optionally cause a pop up dialog box to alert the user if limits are exceeded.

 

Requirements

Software

  • LabVIEW 2012 or compatible
  • NI-DAQmx 9.5.5 or compatible

Hardware

  • NI Multifunction DAQ Device

 

Steps to Implement or Execute Code

  1. Configure the parameter for the right channel and device.
  2. Connect your hardware appropriately.
  3. Run the VI.

 

Additional Information or References

 

 

 

搜狗截图17年01月23日1551_3.png1.  Create or open a TDMS file for saving temperature data.
2.  Set the time betweem temperature checks in seconds (default of 10 seconds).
3.  Get a list of all DAQmx devices in the system.
4.  Check the "DevIsSimulated" property so that you only check the temp on physical devices.
5.  Check the "DevTemp" property to get the temp of each device.
6.  If error -200197 is thrown by the "DevTemp" property then it means that the device does not have a sensor and the results can be ignored.  If error -88705 is thrown by this property then the device is no longer present in the system.
7.  This TDMS write will then write the valid temperature data for all physical devices that have on-board temperature sensors.
8.  Compare the measured temperature with the user defined limits--see the front panel for guidance on setting these limits.
9.  Optionally throw a pop up to the user if temperature limits are exceeded.
10.  Close the TDMS file.

 

I/O Connections Overview:

Make sure your signal input terminal matches the Physical Channel I/O  Control. For further connection information, refer to your hardware reference manual.

 

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

Regards,


h_baker
National Instruments
Applications Engineer

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