LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Analyzing a .TDMS file

Solved!
Go to solution

Hello, I am looking to do some analysis on .tdms file that is generated from my LabVIEW program.  I have a program that generates a .TDMS file with several thousand of data points that list things like date/time stamp, pin status, encoder count, etc.  What I would like to do is write a .vi that parses the data from the .tdms file in batches (.tdms files are produced every 15 minutes) and can do a min/max/average of a column of data. Finally the file should be exported to Excel. I have the last part covered but how would one proceed doing analysis on the .tdms file? Would you even use LabVIEW for this?

0 Kudos
Message 1 of 17
(6,631 Views)

@sam.ferguson wrote:

Hello, I am looking to do some analysis on .tdms file that is generated from my LabVIEW program.  I have a program that generates a .TDMS file with several thousand of data points that list things like date/time stamp, pin status, encoder count, etc.  What I would like to do is write a .vi that parses the data from the .tdms file in batches (.tdms files are produced every 15 minutes) and can do a min/max/average of a column of data. Finally the file should be exported to Excel. I have the last part covered but how would one proceed doing analysis on the .tdms file? Would you even use LabVIEW for this?


Can you provide us with a sample TDMS file? FYI, NI provides a TDMS interface for Excel if that's of interest. Depending on how much data there is to process I would use Excel or LabVIEW. I find Excel to be really good at analyzing small amounts of data (<~20k rows of data) and almost any other tool (like LabVIEW) to be better for large datasets.

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
Message 2 of 17
(6,627 Views)
Why would you use anything else? There are the array min/max and mean functions that do exactly what you want.
Message 3 of 17
(6,626 Views)

Here is an example of the .tdms file. The column Encoder 1 Diff. is what I'm after with the min/max/average.  

0 Kudos
Message 4 of 17
(6,617 Views)

What do you need help with? As Dennis mention there already exist functions for getting the min/max/mean from an array of data? Open quickdrop and type "Array Max & Min" or "Mean.vi" to find those functions. If you need help reading in the TDMS files, then I'll need to see the actual TDMS file. If you need help with concatenating multiple files, then please give me more information on that. Basically describe the input that you have and the output that you desire.

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
Message 5 of 17
(6,608 Views)

I had to post a different .tdms file because the excel file I posted earlier is from a much bigger .tdms file that won't let me upload.  

 

The input in the .tdms file has a date/time stamp, an encoder count, and several other pieces of data arranged in columns as I posted before in the excel file version.  I want to check the already created .tdms file as this is a post-processing application which I don't think I can use array min&max on.  My .vi needs to open this .tdms file, check the column labeled "Encoder 1 Diff." for the maximum value, and record the values from that row starting with the time stamp to a file that can later be imported to Excel.

0 Kudos
Message 6 of 17
(6,602 Views)
The functions mentioned work on arrays and the fact that you are post-processing is absolutely irrelevant.
0 Kudos
Message 7 of 17
(6,592 Views)

So, bear with me Dennis, I use the Read TDMS.vi to open up the file and then from there read the data into arrays? Is that what you are suggesting?

0 Kudos
Message 8 of 17
(6,589 Views)
Sure. Arrays would include the waveformdata type if you need to keep timing information. Unless you do everything in excel, you need to write to something.
0 Kudos
Message 9 of 17
(6,579 Views)

Hi sam.ferguson,

 

I'm a little bit curious of how you exported data from TDMS file to Excel? Do you mean you programmed to do this or just open Microsoft Excel to open the TDMS file. And if you programed to implement it, how did you do this?

 

Thank you!

0 Kudos
Message 10 of 17
(6,558 Views)