NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
Kyle-H
Posts: 153

Re: 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
Applications Engineer
National Instruments
Member
Sappster
Posts: 178
0 Kudos

Re: Read tdms files with Matlab tdm example

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
Member
razor149
Posts: 44
0 Kudos

Re: Read tdms files with Matlab tdm example

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.

Member
razor149
Posts: 44
0 Kudos

Re: Read tdms files with Matlab tdm example

[ Edited ]

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.

Member
razor149
Posts: 44
0 Kudos

Re: Read tdms files with Matlab tdm example

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.

Member
erhk
Posts: 11
0 Kudos

Re: Read tdms files with Matlab tdm example

[ Edited ]

 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.

Member
Kyle-H
Posts: 153
0 Kudos

Re: Read tdms files with Matlab tdm example

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
Applications Engineer
National Instruments
Member
erhk
Posts: 11
0 Kudos

Re: Read tdms files with Matlab tdm example

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.

Member
Kyle-H
Posts: 153
0 Kudos

Re: Read tdms files with Matlab tdm example

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
Applications Engineer
National Instruments
Member
razor149
Posts: 44
0 Kudos

Re: Read tdms files with Matlab tdm example

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.

 

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page