Several roadblocks can impede the optimal exchange of technical information. The most notorious is the improper capture of information at the time of test or simulation. All too often data is stored, without descriptive properties, in inconsistent formats, and scattered about on arrays of computers, creating a graveyard of information that makes it extremely difficult to locate a particular data set and derive decisions from it. As a result, many companies are seeing decreased efficiency and increased development costs.
To meet these challenges, National Instruments has defined the technical data management (TDM) data model for saving well-organized and documented test and measurement data. You can choose from native NI LabVIEW, LabVIEW Real-Time Module, LabWindows™/CVI, LabWindows/CVI Real-Time Module, Measurement Studio, and DIAdem interfaces for reading and writing TDM and TDM Streaming (TDMS) files, the two formats that map to the TDM data model. These interfaces abstract the complexity of storing structured data while making it easy to add descriptive information along with captured measurement or simulation data. In addition, you can use add-ins and libraries to read and write TDM and TDMS files in third-party applications such as Excel.
The TDM data model offers three levels of hierarchy, as shown in Figure 1 – file, group, and channel. The file level can contain an unlimited number of groups, and each group can contain and unlimited number of channels. Because of this channel grouping, you can organize your data to make it easier to understand. For example, you may have one group for your raw data and another group for your analyzed data within one file. Or, you may have multiple groups that correspond to sensor types or locations.
Figure 1. Each TDMS file written in LabVIEW contains descriptive information on the root, group, and channel levels.
Also, you can insert your own custom properties at each of the three levels. Each level accepts an unlimited number of custom-defined attributes to achieve well-documented and search-ready data files. The descriptive information located in the TDM or TDMS file, a key benefit of this model, provides an easy way to document the data without having to design your own header structure. As your documentation requirements increase, you do not have to redesign your application; you simply extend the model to meet your specific needs.
As mentioned previously, there are two file formats that map to the TDM data model: TDM and TDMS. Both map to the same data model so you can create well-organized and documented files with both file formats. However, unlike TDM files, which have a strictly required XML-based header file separate from the bulk data file, TDMS files have a single binary file that contains both the header and bulk data. TDMS files also automatically generate a TDMS_Index file that provides consolidated information on all the attributes and pointers in the bulk data file, and speeds up access to the data while reading.
You can use a number of interfaces to write TDM and TDMS files in LabVIEW. For writing TDM files, you can use the simple Write To Measurement File Express VI or, for more flexibility, you can use the Storage VIs. You can also read and write TDMS files using the Write To Measurement File Express VI, but, to achieve the best performance, use the primitive TDMS VIs from the File I/O palette. To learn more, read the “Writing TDM and TDMS Files in LabVIEW” white paper.
Figure 2. You can choose from several interfaces in LabVIEW to read and write TDM and TDMS files.
As mentioned previously, most NI software packages support reading and writing TDM and TDMS files. To learn more about how to achieve this in a specific ADE, visit one of these resources:
National Instruments developed TDM and TDMS files to help engineers and scientists properly store the large amounts of data they generate during simulation and test. With an easy-to-use interface for storing well-organized and documented files, you can focus your efforts on more pressing areas of your applications.