11-07-2014 11:44 AM
Hello,
I am trying to do something that seems like it should be quite simple but am having some difficulty figuring out how to do it. I am running a test that has over 100 channels of mixed sensor data. The test will run for several days or longer at a time and I need to log/stream data at about 4Hz while the test is running. The data I need to log is a mixture of different data types that include a time stamp, several integer values (both 32 and 64 bit), and a lot of floating point values. I would like to write the data to file in a very compressed format because the test is scheduled to run for over a year (stopping every few days) and the data files can get quite large. I currently have a solution that simply bundles all the date into a cluster then writes/streams the cluster to a binary file as the test runs. This approach works fine but involves some post processing to convert the data into a format, typically a text file, that can be worked with in programs like Excel or DIAdem. After the files are converted into a text file they are, no surprise, a lot larger than (about 3 times) the original binary file size.
I am considering several options to improve my current process. The first option is writing the data directly to a tdms file which would allow me to quicly import the data into DIAdem (or Excel with a plugin) for processing/visualization. The challenge I am having (note, this is my first experience working with tdms files and I have a lot to learn) is that I can not find a simple way to write/stream all the different data types into one tdms file and keep each scan of data (containing different data types) tied to one time stamp. Each time I write data to file, I would like the write to contain a time stamp in column 1, integer values in columns 2 through 5, and floating point values in the remaining columns (about 90 of them). Yes, I know there are no columns in binary files but this is how I would like the data to appear when I import it into DIAdem or Excel.
The other option I am considering is just writing a custom data plugin for DIAdem that would allow me to import the binary files that I am currently creating directly into DIAdem. If someone could provide me with some suggestions as to what option would be the best I would appreciate it. Or, if there is a better option that I have not mentioned feel free to recommend it. Thanks in advance for your help.
11-07-2014 01:36 PM
Hello,
Here is a simple example, of course here I only create one value per iteration in the while loop for simplicity. You can also set properties of the file which can be useful, and set up different channels.
Beside, you can use multiple groups to have more flexibility in data storage. You can think of channels like columns, and groups as sheets in Excel, so you see this way your data when you import the tdms file into Excel.
I hope it helps, of course there are much more advanced features with TDMS files, read the help docs!
11-07-2014 03:42 PM - edited 11-07-2014 03:43 PM
I agree that TDMS could be a useful file format for your application. Perhaps taking a look at this white paper regarding some TDMS best practices could help you decide how to store the data and meta data : Writing Data-Management-Ready TDMS Files. Hope this helps.