Thanks to Philip Top, the updated function dated 17 MAY 11 fixes a couple of bugs that arose with NI-DAQmx 9.2.3. It should post here soon. I don't know if it will help with the "out of memory" issue that Sage has encountered.
It sounds like to me that your issue may be caused by interleaved data. Regrettably, dealing with that is out of my realm of expertise. I recommend checking your LabView application that's creating the file to see if it is in fact writing the data with an interleaved layout. Unfortunately, LabView may be doing it automatically (i.e. you can't change it) as part of its undocumented "optimization" algorithm. I suspect that the latter is the case, especially since the Excel TDMS add-in reads the file correctly. Perhaps Philip Top has some recommendations on how to fix your issue.
As you found out, using NI's DLL isn't a very robust solution. Initially, I tried using it to read my TDMS files and it didn't take long for me to abandon that approach and develop this function.
Since I can't reproduce the error with any of the sample data files that I have, I'm sorry to say that I can't attempt to fix your issue without a file that does.
What do you mean by "... recent format change.. "? Is that a change in how LabView is writing the file, did you change TDMS versions, etc.? If possible, can you please send me a sample data file? That'll probably be the easiest way to try to debug this.
Hi, thank you very much for developing this code. I am having some trouble extracting the data from my TDMS files. After conversion, there will be a 1x1 structure with "FileName", "FileFolder", "SegTDMSVerNum", "NumOfSegments", and "Data". However, none of these values contain the actual measurement data. Under "Data", it only lists the names of the channels measured from my data acquisition board (under "MeasuredData", and the "Root".
Does this code allow you to be able to extract the measured data? Or only the structure of the TDMS file.
You need two input arguments.
e.g.:
a = convertTDMS(0,'filename.tdms');
Zero as the first argument states that you don´t want Matlab to save the converted data automatically. If you give a 1 as the first argument the data will automatically be saved as a .mat- file.
It works for me! Thank you very much. Saves a lot of time.
In my case, reading 85 MB TDMS file takes 1 hour. And there is an error:
In an assignment A(:) = B, the number of elements in A and B
must be the same.
Error in ==> convertTDMS>postProcess at 1109
Value(c)=index.(cname).(cfield).value;
Error in ==> convertTDMS at 287
[ConvertedData(fnum).Data,CurrGroupNames]=postProcess(ob,channelinfo);
Hi, thank you very much for developing this code. I am having some trouble extracting the data from my TDMS files. After conversion, there will be a 1x1 structure with "FileName", "FileFolder", "SegTDMSVerNum", "NumOfSegments", and "Data". However, none of these values contain the actual measurement data. Under "Data", it only lists the names of the channels measured from my data acquisition board (under "MeasuredData", and the "Root".
Does this code allow you to be able to extract the measured data? Or only the structure of the TDMS file.
Thanks!
Comment only
04 Nov 2011
ConvertTDMS (v9)
Import a LabView TDMS file into the MATLAB workspace
You need two input arguments.
e.g.:
a = convertTDMS(0,'filename.tdms');
Zero as the first argument states that you don´t want Matlab to save the converted data automatically. If you give a 1 as the first argument the data will automatically be saved as a .mat- file.
It works for me! Thank you very much. Saves a lot of time.
BR, Daeniel
Comment only
10 Oct 2011
ConvertTDMS (v9)
Import a LabView TDMS file into the MATLAB workspace
Hello. I can't run this application. When I press the start button the following error appears:
??? Error using ==> convertTDMS at 225
Not enough input arguments.
I'm still a dummy user of Matlab....
Can you help me, please? Thanks.
Regards
Daniele
Comment only
22 Sep 2011
ConvertTDMS (v9)
Import a LabView TDMS file into the MATLAB workspace
Thank you for your contribution. I appreciate it.
In my case, reading 85 MB TDMS file takes 1 hour. And there is an error:
In an assignment A(:) = B, the number of elements in A and B
must be the same.
Error in ==> convertTDMS>postProcess at 1109
Value(c)=index.(cname).(cfield).value;
Error in ==> convertTDMS at 287
[ConvertedData(fnum).Data,CurrGroupNames]=postProcess(ob,channelinfo);
Thank you!
Comment only