Example Code

Writing Units and Description to a TDMS File in LabVIEW

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.

    Software

  • LabVIEW

Code and Documents

Attachment

1. Overview:

This example writes a simulated signal to a TDMS file and adds channel information 

 

2. Description: 

The TDM data model offers three levels of hierarchy: root, group, and channel. Each level accepts an unlimited number of user-defined attributes, which makes the files search-ready.

This example demonstrates how to write units and/or description to the channel level using the TDMS Set Properties function.

 

3. Requirements

  • LabVIEW 2012 (or compatible)

4. Steps to Implement or Execute Code

  1. Run Write TDMS with channel properties LabVIEW 2012 NI Verified
  2. Select a place to save your TDMS File
  3. In the TDMS File Viewer select a channel and verify that the "Description" and "Unit_String" properties are present

 5. Additional Information or References  

Block Diagram

Block Diagram.JPG

 

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

 

Chris Van Horn
Applications Engineer

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

Comments
yin_the_novice
Member
Member
on

Thanks so much for posting this , it helped me a lot on my project

Jason93
Member
Member
on

chris this looks nice but what if you want to have different  units for each signal. This makes the units the same for all.

jason