From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Direct access to TDMS files

Hello,

 

I have a collection of TDMS files. Some only have a single group of data, some more, but otherwise the structure is quite straightforward - array of, say, 8 waveforms. Is there a simple way to read a chunk of data between TimeX to TimeY? Ideally, cutting throuhg the file boundaries, if necessary? 

 

I understand that it is quite simple to do, from starting time and increment time calculate the index of the first point etc.. But TDMS is lauded as system with easy direct access to data. And I can not find anything available for such simple a task.

 

Another simple question - is it possible to read unscaled data? ReadTDMS vi output floating point number, but, from the size of the file it is clear, that the data is stored as I16. Is it possible to read it as I16? Obviously I tried wiring I16 to "data type" input, the values read are rounded floating point results, i.e. in my case, 0s (the signal is <1 volt).

 

Yury

0 Kudos
Message 1 of 10
(3,288 Views)

Okay there are several questions in there.  First direct access to TDMS files is easily done with the TDMS palette under File I/O.  There you open a path to a TDMS file, then you can get the contests and find what groups, and what channels in those groups exists.  You can also use functions to find the properties stored on the file, or groups, or channels.  There is an example viewer on that palette that works for many cases.

 

As for the specific questions with your files, you'll need to post an example file to understand what you mean.  You can read waveforms as waveforms, getting you the T0 DT and Y values.  From there you can calculate all the times associated with each data point.

 

The best answer to reading unscaled data, is to write unscaled data.  If you write the data as a U8 it will be stored as a U8.  And doubles are stored as doubles.  The data as it is in memory, is how it is written to disk.

0 Kudos
Message 2 of 10
(3,278 Views)

If you read my message you will see that I've outline the solution you propose. However, I was hoping that TDMS has some conveniet higher-level layer to deal with such tasks.

 

As for reading raw data, they where written by the driver. I suppose I could have forced the driver to log I16 data, thus loosing the scaling information, but it is too late now. 

 

Of course, I've found a solution, but it seems to me that TDMS format lacks both high-level and lo-level access to the data, the result appears to be rather unconveniet

 

Yury

0 Kudos
Message 3 of 10
(3,272 Views)
For a higher level tool, you should consider DIAdem - http://www.ni.com/diadem/
0 Kudos
Message 4 of 10
(3,257 Views)

I want what I've asked for - convenient access to TDMS files in Labview. Diadem is not a solution. Bsedies, as far as I can see it does not the functionality I seek (cut time-periods from waveforms cutting through file boundaries).

 

This is not a solution. Despite beiing somehow approved as such.

0 Kudos
Message 5 of 10
(3,247 Views)
You never specified that you required it in LabVIEW. You simply asked for a simple way to access the data. You are the one who marked my answer as the solution.
0 Kudos
Message 6 of 10
(3,242 Views)

Oh! did I click on the wrong button? Not impossible, sorry.

0 Kudos
Message 7 of 10
(3,227 Views)
You can change it by clicking on Options. I would recommend you do that since questions marked as solved are often unread.
0 Kudos
Message 8 of 10
(3,221 Views)
Hi, 1)According to your requirements, one solution I think is that you might concatenate TDMS files with same group and channels to one and then use TDMS read to set correct offset and count. 2)So far there is no way to read unscaled data out in LabVIEW directly. Since TDMS file format is open, you have to parse TDMS file and get the unscaled data by your own.
0 Kudos
Message 9 of 10
(3,159 Views)

At one point I was experimenting with removing scaling on a channel to get the raw data.  It was possible but it became more difficult when there are multiple scale types (Linear, table, polymorphic, etc) and supporting all of them and having the code to detect which one was being used was a bit of a pain.  That's why I suggested logging raw data, if the user actually wants it raw.  Then you can apply a scale, or copy the data to another channel and apply a scale.

0 Kudos
Message 10 of 10
(3,124 Views)