Blog

TDMS Tools

TDMS Tools

Data managment in Test and Measurement applications is critical to the usability of the final product. It is no use to acquire data if you can't use it. Traditionally, we would write data out into some form of tab delimited text file. This works really well but has some significant drawbacks in larger file size and loss of precision.

Enter TDMS, a file format created by National Instruments which provides the ability to write complex data formats to a single binary file readable by Microsoft Excel, Diadem, or your own custom software. As awesome as TDMS is, it is write only. You can add to the file all you like but changing names, recalculating columns of data, deleting data and more are just not possible.

This limitation leaves us with only one option, that is to read in the data, modify it and write it back to a new file. Building on a concept given to me by Brent Hoerman, I created a set of tools to read in a TDMS file into a common set of data structures. This allows arbitrary operations like group deletion, data modification, automatic data archiving, and writing the data back to a new file. Combining these tools with a file manager that allows importing changes made to data using the Excel Add-in allows us to break away from the text-based file format for good.

Learn more about DMC's test and measurement automation expertise.

Comments

Leon Grossman
# Leon Grossman
Laura,

My tools are based in LabVIEW and would be of little use with VB and C++ development. Have you checked the following resources?

http://zone.ni.com/devzone/cda/tut/p/id/9341

Feel free to email me at leon.grossman@dmcinfo.com if you think my LabVIEW based tools may be helpful.

Leon
Laura Lage
# Laura Lage
Hi,

I stumbled accross your article on TDMS on TDMS-Tools. I have been trying to figure out how to use the TDMS library supplied by NI to write TDMS files. So far, I am able to write numbers to the file but have not had any success writing strings or timestamps. The string writing causes crashes and the timestamp written does not appear properly in the XML file created. I have a feeling that I am not passing the variables into the calls properly but have not had any success no matter how a configure things. I can write and read the timestamp back, getting the same value, but the fact that the timestamp in the XML file is wrong, makes me believe that the data is not stored properly to begin with.

Ultimately, I would like to interface to the TDMS libraries via VB and have been writing test programs in both VB and C++, getting the same problems in both languages.

How can I get a copy of the TDMS-Tools mentioned in your blog???

Thanks in advance, Laura Lage
Leon Grossman
# Leon Grossman
Brent,

The files are still write-only and my tool set keeps the original files after every change. Even if you don't want to use the "editing" functions of my tools, the tools we wrote can still be used to easily assemble a complex TDMS structure with much less effort than assembling the structure by hand with TDMS write functions.

--Leon
Brent Hoerman
# Brent Hoerman
Leon--

First, thanks for the 'props'. Second, you would have come up with this strategy on your own. Third, you have taken it much further than I ever would of... what a great set of tools.

Only comment is that some end users actually appreciate the "write only" features of a TDMS data log file. It ensures that the data recorded in the file is what was actually recorded, and completely unmodified.

I guess I will have to re-think that selling point for TDMS if your tools are ever widely available!

--Brent

Post a comment

Name (required)

Email (required)

CAPTCHA image
Enter the code shown above:

Related Blog Posts