09-08-2010 02:14 PM
I am having trouble reading TDMS file in MATLAB. I have download NI matlab example code for it. I get it to work for their TDM file but it is not working properly for my file. I have 3 groups of channel. But even though I specified the channel group which I want to read it is reading the wrong channel group and MATLAB code is spitting an error of "undefined function or variable chanvals".
The channel group I want to read contains 16 channels. The data size is 0.8 million x 16. First column is time and rest of the columns are strain. At the end of the time I want to read this TDMS file in MATLAB and plot time vs. strain for all the channels, time on x-axis and strain on y-axis. Is the existing NI code capable of doing this or I have to modify the code to do this operation.
Any help is really appreciated.
Thank you very much.
09-09-2010 05:23 PM
Which NI example are you using to do this? The latest example that I have found was this which works with both TDMS 1.0 & 2.0 files.
09-09-2010 05:35 PM
This is the same example, I have been using. But no success yet and my files were created in Labview. I am using cRIO from NI as my DAQ. I am wondering is their any user guide to use this example? because I have been going between MATLAB code (ReaderFile.m) and header file (nilibddc_m.h) and modified bunch of times to get it work but no luck yet.
I have modified header file with my file, channel group and channels properties but it does not work. I would greatly appreciate if their exist any user friendly poineters to use NI MATLAB code to read TDMS file.
Thanks so much for your reply.
09-10-2010 05:27 PM
I have plenty of experience working in LabVIEW and with TDMS however very little in using it in other software. I have downloaded the example code on this end but since I don't have your software installed on my machine, there is not a ton I can do in walking you through it. However, I understand this is a very helpful newsgroup for that environment.
Since you said you modified the header, to make sure everything is in line prior to entering other program, this is a good resource on the TDMS file structure.
10-13-2010 05:09 PM
Are you still experiencing trouble reading your TDMS file. The error you mentioned makes me believe it is most likely a datatype mismatch. You can view the contents of the variable type when you obtain that error to view the detected datatype of the values in the tdms file. You will want to ensure that this datatype mirrors the datatype used in line 165 and line 169 of the ReadFile.m example.
Let me know if I can be of more assistance.