ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

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: https://forums.ni.com/t5/Example-Code/Reading-TDM-TDMS-Files-with-The-MathWorks-Inc-MATLAB-Software/...

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
(4,262 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
JM, LabVIEW CLA
0 Kudos
Message 2 of 3
(4,223 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
(4,169 Views)