This is part one of my blog series detailing the use and optimization of the TDMS format. Here is a table of contents for all blogs in this series:
LabVIEW Data Storage: Overview of TDMS
LabVIEW Data Storage: TDMS Performance Tweaking
LabVIEW Data Storage: TDMS Usage Case Study
Here at DMC, almost all of our LabVIEW applications acquire data at one point or another. This data often needs to be saved to disk for later review, display, and/or exported to a report. Years ago, logging to disk would mean working with our client to decide what type of file format fit their needs the best.
If they were concerned about disk space and needed high speed streaming rates we would use a raw binary file or other binary format like NI's datalog. If they wanted the data available for review and calculations in Excel we would create a CSV file with the trade-off being speed and large log files. If they were simply looking to save settings or setup data we would use an INI file format. In the last couple of years though, NI has released a file format called TDM which was later expanded by a format called TDM Streaming or TDMS.
TDMS is described fairly in depth on National Instrument's site (NI TDM Data Model). Essentially, it's a file that includes a combination of metadata strings for things like names/properties/hierarchy and binary data for higher throughput, more byte consuming raw data. This model gives it the flexibility of an INI or XML file but with the high speed access and efficiency of a pure binary file.
Because of the great utility of TDMS, we find ourselves now using it on nearly every LabVIEW project, even if it's just to save some data during the debug phase.
To get started with TDMS, search the LabVIEW examples and start with the simplified "Write TDMS File.vi" and "Read TDMS File.vi". You can easily access the TDMS functions from the LabVIEW Palette. Just look in the File I/O submenu.
My next blog post will focus on TDMS performance and what's happening behind the scenes. Before going much further, I recommend familiarizing youself with with the concept of Groups, Channels, and Properties and how they can be used within the TDMS Hierarchy. Either look through the NI site on this subject (NI TDM Data Model) or play around with the example VIs until you have a good feel for what's going on.
The next blog in this series isLabVIEW Data Storage: TDMS Performance Tweaking
Learn more about DMC's data analysis, data mining and reporting expertise.