To download NI software, including the products shown below, visit ni.com/downloads.
This document contains information and VIs to provide you with TDMS writing capability for the following:
The TDMS file format is designed to write and read measured data at a very high speed, while maintaining a hierarchical system of descriptive information. Although the binary layout itself is simple, the optimizations TDMS enables by writing meta data incrementally lead to very sophisticated file configurations. The installed TDM Streaming application programming interface (API) in LabVIEW hides this complexity. However, the installed TDM Streaming API is available only for Windows and Phar Lap for the LabVIEW Real-Time Module, and requires LabVIEW 8.2 or later.
Use the G TDMS VIs to complete the following actions:
Note Equivalent functions for reading TDMS files on VxWorks, Mac OS, and Linux are not available at this time. You can read TDMS files on Windows using LabVIEW 8.2 or later, NI DIAdem 10.0 or later, or Microsoft Excel 2003 or later. You can download the TDMS Add-In for Microsoft Excel from the National Instruments Web site at ni.com (linked below).
The TDMS VIs available for download are G TDMS Open, G TDMS Write, G TDMS Close, and G TDMS Set Properties. G TDMS Write and G TDMS Set Properties are polymorphic VIs that allow you to write a large variety of data types to the file.
|G TDMS Open||Opens a .tdms file for writing. You also can use this function to create a new file or replace an existing file. Use the TDMS Close function to close the reference to the file.|
|G TDMS Write||Streams data to the specified .tdms file. The data subset to write is determined by the values you identify in the group name and channel name(s) in inputs.|
|G TDMS Close||Closes the .tdms file you opened with the TDMS Open function.|
|G TDMS Set Properties||Sets the properties of the specified .tdms file, channel group, or channel. The properties are written to a channel group or channel if you wire the group name or channel name inputs with values. If the group name or channel name inputs contain no values, the properties values become file-specific.|
The VI icon has a blue background, as seen in the following figure, and the VI name begins with G TDMS.
Refer to the Downloads section of this document to download the G TDMS VIs.
After you download the VIs, you can access the VIs from the labview\user.lib directory. Refer to the Adding VIs and Controls to the User and Instrument Drivers Subpalettes topic (linked below) in the LabVIEW Help for information about adding the VIs to the User Libraries palette.
The following list describes some of the caveats and recommendations to consider when you download and utilize the G TDMS VIs.
There are no additional help files available in this document for download. Refer to the following topics in the LabVIEW Help for more information about TDM Streaming VIs and how to add the G TDMS VIs to the User Libraries palette.How-Separate-2
Developer Zone: Introduction to LabVIEW TDM Streaming VIs
Developer Zone: TDMS Add-In for MS Excel
Developer Zone: TDMS File Format Internal StructureRelated-Separate-2
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.