LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with TDMS in Matlab

Hi B.Wagner,
 
The "Read_TDMData.m" example was written and tested with versions R2007a, R2007b, and R2008a.  These versions are capable of handling libpointer strings and strings somewhat interchangeably, which I do not believe version R14 does as well.  If you try replacing 'DDC_FILE_NAME' with 'DDC_FILE_NAME.Value', then this line should execute properly.  I cannot guarantee that the two examples provided will work as expected with anything earlier than R2007a, since I haven't tested them with those earlier versions, so please let me know if you encounter any other issues or if the above solution doesn't work.
 
Chris M
0 Kudos
Message 11 of 18
(1,898 Views)
Hi Chris M.

Thanks fot the fast help.
  I don't encounter the error anymore after I expanded all the DDC_FILE_xx expressions (thus Name, Description, Title, Author and Datetime) by the '.Value' term. The only thing that astonishes me a bit is that there's not a single outpout. The program simply runs, finishes and leaves me a blank screen. Is the example made like this on purpose (no title, date or graph for the values) or is it another incompatibility with my system?

B.Wagner
0 Kudos
Message 12 of 18
(1,880 Views)
Hi Chris M.,

after working on a different project I returned to my tdms-Stream. As I wrote in my last message the inital error when using the 'ReadTDMData'-example disappeared after I made the changes you proposed. I didn't worry much about the blank screen when testing the routine with the 'SineData.tdm' file since I blamed my older Matlab-version for it.

Lately I perfomed a test with one of my proper .tdms recordings (see file attached) and I get the following error message right after loading the file:

>> ??? error using ==> calllib
>> Array must be numeric or logical or a pointer to one.
>>
>> Error in ==> Read_TDMData at 43
>>    calllib('nilibddc','DDC_GetFileProperty',pfile.Value,DDC_FILE_NAME.Value,pfilename,pfilenamelen.Value+1);

Is there an error in my recording or is it again a problem with my Matlab Version??

greetings

B.Wagner
0 Kudos
Message 13 of 18
(1,786 Views)

Hi B.Wagner,

It looks like the file you attached is a .lvm file, not a TDM or TDMS file.  Is that what you are reading from?  Do you have a .tdm or .tdms file you can post that gives the same error?

Jennifer R.
National Instruments
Applications Engineer
0 Kudos
Message 14 of 18
(1,768 Views)
Hi Jennifer R. Oops...looks like I attached the wrong file....sorry for that...here's the tdms.... Greetings B.Wagner
0 Kudos
Message 15 of 18
(1,745 Views)

Hi B.Wagner,

I was able to read the file in Excel, using the TDM Excel Add-In, so the data seems to have been logged correctly.

Jennifer R.
National Instruments
Applications Engineer
0 Kudos
Message 16 of 18
(1,712 Views)
I wasn't aware of this, but NI has included an example in Matlab to write TDM files. I just tried it out and it works perfectly.
Thanks a lot!
0 Kudos
Message 17 of 18
(1,706 Views)
Hi Jennifer R., O.K....so it appears to be a problem with my 'ancient' Matlab version 😕 . I'll try to get a newer one. Thanks for the help! B.Wagner
0 Kudos
Message 18 of 18
(1,698 Views)