From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read TDMS files with Matlab

I am trying to read a TDMS file in Matlab.  I used the zip file from here: http://www.ni.com/white-paper/7446/en/

But if I try to run the example I get an error:

 

Error using loadlibrary (line 253)
A 'Selected' compiler was not found.  You may need to run mex -setup.

Error in ReadFile (line 30)
loadlibrary(NI_TDM_DLL_Path,NI_TDM_H_Path);
 

If I try the procedure here:

 

examplePath = 'C:\test';
hfile = [examplePath '\nilibddc_m.h'];
loadlibrary([examplePath '\nilibddc'], hfile);

I get the same error. Is it correct that I should get the file from the dev directory?

 

 

0 Kudos
Message 1 of 3
(3,445 Views)

Might be due to different version you get the error. Obviosly the code have been working for some.

 

I've also seen an tool that Mathworks made

http://www.mathworks.com/matlabcentral/fileexchange/30023-tdms-reader

Best Regards
Jonas Mäki
Systems Developer
Novator Solutions
0 Kudos
Message 2 of 3
(3,406 Views)

Thanks for the response. But the this tool does not seem to work also:

Error using TDMS_processLeadIn (line 50)
Currently code is unable to ignore/handle Raw Daq MX data

Error in TDMS_preprocessFile (line 179)
    [flags,info,eof_error]  = TDMS_processLeadIn(fid,lastLetter);

Error in TDMS_readTDMSFile (line 226)
metaStruct   = TDMS_preprocessFile(fid,tdmsFileName,paramsStruct);

Error in TDMS_getStruct (line 57)
[temp,metaStruct] = TDMS_readTDMSFile(filePath,readOptions{:});

It is not compatible, als NI did not want to release their format according to the author:

 

 

@Joe,

National instruments won't release the specs for their daqmx format (I've asked), so I don't know what their binary data means. They recently updated their dll to support reading version 2 files, so you might have luck using that. I've been meaning to look at the dll but it's really low on my priority list at this point.

 

0 Kudos
Message 3 of 3
(3,352 Views)