LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read multi-channel waveforms from TDMS

I've been using the built-in waveform write and read VIs for years, and have always had to work around the 2GB file size limit.  I read about the TDMS files, and tried to use the express version to create a multi-channel waveform file.  Now I can't figure out how to read the file and pick out discrete records.  When I use the Read TDMS VIs (express or not) I get a "Not enough memory" error. 

 

I've attached the VI I used to write the file (LabVIEW 8.5.1).  How can I read files created this way?

 

JR

Aerodyn Engineering

0 Kudos
Message 1 of 8
(6,676 Views)

Hey,

 

Did you try the "Read TDMS.vi" which you will find using the NI Example Finder (LabVIEW Help menu > Find Examples).

Btw, when I run your VI I receive an error, because you open the reference of the File twice....., once when writing the data with the express vi, and once with the get file size vi.

 

Christian

Message 2 of 8
(6,661 Views)

Christian,

Odd that I don't get that error. The file size subVI is not necessary; I just wanted some way to track it other than Windows Explorer.

 

I did try the included example, as well as using the express TDMS read.  Neither worked satisfactorily.

0 Kudos
Message 3 of 8
(6,650 Views)

You get the "not enough memory" error, because by default LabVIEW tries to read the whole file into memory at once. If your file is too large for that, you need to load it in smaller pieces. Use the TDMS Get Properties function to figure out how many values a given channel has (unless you know that already). The property you need is NI_ChannelLength. You can then wire the offset and count inputs on TDMS Read in order to determine which subset of your channel(s) you want to read. In case you need some example code for that, you might want to look into the TDMS File Viewer VI.

 

Hope that helps,

Herbert 

0 Kudos
Message 4 of 8
(6,625 Views)

Herbert,

 

I've been unsuccessful still at reading from the file created with the Express TDMS write.  Based on experiments using your advice, however, I've been able to see that there is information there, I just can't access it outside of the TDMS file viewer.  Using the regular TDMS write, I've been able to create other files that I can read.  Experiments are continuing, but I'm cautiously optimistic.

 

Thanks for your help.

Message 5 of 8
(6,586 Views)
Success!  I created a 7+ GB file, with 8 channels sampled at 10,000 samples/sec.  TDMS read worked perfectly.  Best part of the transition to LabVIEW 8+ for me thus far.
Message 6 of 8
(6,574 Views)

Dear AEI_JR,

 

How did you eventually get the TDMS file viewer to work with large files? 

0 Kudos
Message 7 of 8
(6,343 Views)

The post above is misleading, I think.  I stopped short of using the Express TDMS read, instead, I use the streaming subVIs.  I've attached examples of how I use them (LV 8.5.1).

 

JR

Download All
Message 8 of 8
(6,328 Views)