Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Read tdms files with Matlab tdm example

Razor,

 

Try to create a small data file that displays this behavior.

Can you please post your Signal Express project that generates the tdms file and the tdms file that you are unable to read in MATLAB?

 

Can you read the TDMS file with TDMS viewer or read it in LabVIEW?

Kyle Hartley
Senior Embedded Software Engineer

Message 21 of 32
(2,898 Views)

Hi Razor,

 

I don't have the m file in front of my currently so this is all hypothetical thought, but the example ReadFile.m is intended to demonstrate how to use the TDM file reading function and is designed specifically for the sinewave tdm file provided, i.e. it pulls chan types and file header information specific to that tdm file. The error may be comming from the fact that your tdms file does not contain the same information, namely the file description it is attempting to read near line 57. With regards to the error you mentioned about chanvars, check to see if you are receiving an error when instantiating that variable.

Sappster
0 Kudos
Message 22 of 32
(2,883 Views)

Hi Kyle,

 

Thanks for your reply. Here are the requested files attached.

 

The TDMS file works perfectly in LabVIEW SignalExpress.

 

Hoping to see your reply soon.

Download All
0 Kudos
Message 23 of 32
(2,879 Views)

Hi Sappster,

 

Thanks for your reply!

 

I will begin going through the code, and try to find what I can edit, to make the code more genearalised, if what you ware saying is true.

 

But its surprising that no where is it mentioned that the code uploaded on ni.com is example-specific.

 

Thanks.

0 Kudos
Message 24 of 32
(2,878 Views)

Hi Kyle and Sappster,

 

Another question closely related to this one:

 

Assuming that Kyle or I can find a way to open any TDMS into MATLAB, will MATLAB still be able to open a 10GB TDMS?

 

That is my final aim.

 

Thanks.

0 Kudos
Message 25 of 32
(2,875 Views)

 I am able to read exmple .tdm file. I had a same error message when I tried to read my .tdms file in MATLAB.

 


 

My .tdms file size is 300MB and it was generated from LabVIEW SignalExpress.

 

Any help would be appreciated.

0 Kudos
Message 26 of 32
(2,858 Views)

Razor and erhk,

 

I believe the issue is with TDMS 1.0 vs 2.0. There was an old KB that had the information about how the code didn't work for TDMS 2.0. I have found another option for you guys. 

 

Please check out this link. I was able to open Razors tdms file without any issues.

http://www.mathworks.com/matlabcentral/fileexchange/28771-converttdms-v9

 

Kyle Hartley
Senior Embedded Software Engineer

0 Kudos
Message 27 of 32
(2,829 Views)

Kyle,

 

Thank you for your suggestion about reading TDMS file. I am able to read a file in the MATLAB but it only returns me following :

 

FileName: 'Digital_Input.tdms'
FileFolder: ''
SegTDMSVerNum: [190x1 double]
NumOfSegments: 190
Data: [1x1 struct]

 

It also generates .mat file corrosponding to the .tdms file. However, none of these values contain the actual measurement data.

 

Does this code allows to extract actual measurement data.

 

 

Thank you.

0 Kudos
Message 28 of 32
(2,811 Views)

Erhk,

 

Please make sure you are using the correct calls.

 

Unfortunately, I can't support another software for calling into TDMS documents. The standard is defined and we follow the standard. If the issue becomes related to how we are creating the TDMS file please let me know and I will be able to help. It seems plenty of other people have gotten it to work so maybe contact someone on that page as to how they got it to work.

 

Kyle Hartley
Senior Embedded Software Engineer

0 Kudos
Message 29 of 32
(2,780 Views)

Hi Kyle,

 

Thanks a lot for your reply and help!

 

I am yet to try out your solution.

 

For now, I have got my hands on LabVIEW Eval, and Binary files are working in an awesome way too !

 

I have to decode some of the headers though, if I want to read them into MATLAB, which should be simpler than trying to decode how the TDMS code works in MATLAB.

 

So lets see where this goes!

 

Again I appreciate your help.

 

Thank you.

 

0 Kudos
Message 30 of 32
(2,775 Views)