LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MULTIPLE Groups IN TDMS file

Solved!
Go to solution

Hello all,

I am trying to write measured data in Labview in TDMS format. The point I don't get is the significance of multiple groups in TDMS file. Can you please clarify that? Because in my case, I get 16 groups for channel 0 and I don't know which group to consider.

What if, I use one segment header only instead of one header per segment? Does that affect my actual reading? 

Regards and Thanks,

Pieterson

0 Kudos
Message 1 of 3
(3,977 Views)

Hi,

 

As far as I understand, each write you perform will have a header associated with in. Generally file size and performance is limited by the ratio of header to body. ie more headers and less bodies increases file size and lowers read rate. If possible, save up writes in an array in (preallocated) memory and only dump it to file when you have lots to write.

 

When you do a TDMS write you are asked for channel and group. If you pass an array into the data input then the group can be an array, indicating that you want your data put into the different headings. You could do each heading as a separate write, but the TDMS function allows you to to do a bunch at once. Whether this is relevant depends on your application; do you have the data for all the groups available when you want to write?

 

I believe the TDMS write will allow you to leave the channel and group unspecified, in which case the write will autofill the header with 'Channel n' and 'Group m'. But these names will depend on what the TDMS write thinks rather than what is relevant to your program. You should ensure you name your writes so that when you look through the file you can clearly identify which data is relevant.

CLA - Kudos is how we show our appreciation for comments that helped us!
Message 2 of 3
(3,953 Views)
Solution
Accepted by Pieterson

Here is a presentation I gave at NI Week, and here is a slightly updated presentation I gave later.  In them I have a slide dedicated to the TDMS structure (slide 5 in the second presentation)  This tries to explain that TDMS files can be structured in any way you want and organization comes in 3 levels.  But maybe an easier way to visualize and understand why you might want multiple groups, is to look at the parallels with Excel.  In Excel you have a work sheet (group), in it there are columns (channels) and there are rows (samples of channels).  So if you are asking why you would want different groups it is like asking why you might want different worksheets in Excel?  I mean you can put everything in one sheet but it might get confusing.  One common reason people use different groups is they have signals sampled at different rates.  In Excel if the first column is "Time" and then each column after is something like Voltage 1 and Temperature 1, then we assume each channel being sampled is logged at the same rate.  But if these two things are sampled at different rates it might be a better design to have different groups.  Each group (worksheet) can have a "Time" column, but they can have different values.  And then all channels are assumed to work off of the Time column in that group.  Of course if you are logging the Waveform data type you don't really need to worry about this since the Start and DT is stored as properties of the channel.  This is really most useful in XY type logging where the data coming in might not be at a defined rate.

Message 3 of 3
(3,944 Views)