LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Errors while reading TDMS files in MATLAB of Raw Daq MX data type

I am trying to read a TDMS file with data type of Raw DAXmx using matlab example by NI. I am getting the following error while running the 64 bit version:

 

?? There was an error loading the library "C:\MATLAB TDM Example\dev\bin\64-bit\nilibddc"
Error using ==> loaddefinedlibrary
C:\MATLAB TDM Example\dev\bin\64-bit\nilibddc.dll is
not a valid Win32 application.

 

Error while running 32 bit version:

 

??? Undefined function or method 'setdatatype' for input arguments of type 'uint64'.

Error in ==> ReadFile at 177
setdatatype(vals,'doublePtr',1,numvals);

 

I tried using the matlab submissions like 'http://www.mathworks.in/matlabcentral/fileexchange/30023-tdms-reader' to read TDMS files. I am getting the following error:

 

Currently code is unable to ignore/handle Raw Daq MX data

 

Following explanation for this error is given in the documentation of this code

 

%{

TDMS files can store many different types of data inside of them, such as
uint8, int16, doubles, etc. A full list is outside the scope of this document.

One of these data types is rawDAQmx. I think this data type is actually the
bit representation captured by the DAQ (hence the name raw). The presence
of this data type in the meta for a TDMS file refers to the fact that the
data has a true IEEE like data type underneath, as well as properties that
are stored with the file that inform the user how to scale the data from
the the bit-level representation to a true number.

The primary reason one might use this format is because it gets rid of the
intermediate step of converting the data to a known data type before
saving. This could be advantageous because it could save computational
time and memory from not doing the conversion, as well as time and disk space
from writing a smaller file to disk.

This data type however is not an open specification. In the TDMS file the
header before the data will specify that upcoming data has this data type,
allowing one to skip over that data section.

I have contacted the NI about this and received the following response:
%==========================================================================
I apologize but since most of the TDMS format is a National Instrument
proprietary file structure I can really only help you out with any of the
information that is already provided. I have included a link to a
KnowledgeBase below that walks through TDMS in a lot more detail. Please
have a look through and hopefully it will answer some of your questions.

TDMS File Format Internal Structure
http://zone.ni.com/devzone/cda/tut/p/id/5696
%==========================================================================

That being said I have been able to obtain the data from this format in
some example files that I created. However, since these example files are
relatively few, and since I have no idea how to generalize my code, I have
not formally included support for this data type. If I get some more
example files with rawDAQmx data I would likely include a mode in which one
could attempt to retrieve data from this data type.

Finally, National Instruments does provide some old drivers. I think they
only work for 32 bit Windows but they may support the rawDAQmx data type
...

%}

 

 

Please show me a way out of this problem.

 

Thanks & Regards,

Pradeep Grandhi

0 Kudos
Message 1 of 3
(4,240 Views)

How about to open the TDMS file in Microsoft Office Excel, save it to a .xlsx file and then import it in Matlab?

Message 2 of 3
(4,219 Views)

YongqingYe,

 

Thanks for the prompt reply. I have hundreds of TDMS files to process. It would be a time taking task for me to convert every TDMS file to excel.

 

Thanks

 

Pradeep Grandhi

0 Kudos
Message 3 of 3
(4,196 Views)