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: 

TDMS file will not properly import into Matlab

Solved!
Go to solution

katho,

 

I tried the same thing but it didn't worked for me.

Can you please tell me what you did to make loadlibrary function work in 64bit machine?

 

 

Thank you

0 Kudos
Message 21 of 24
(1,050 Views)

I just followed the instructions given in the link. I looked through the comments, though, and it seemed that if you are running a different version of VC or SDK, you might not be able to use the instructions in the same way.

0 Kudos
Message 22 of 24
(1,039 Views)

If you are using a newer version of MATLAB, there may be a separate issue. I recently tried using R2011b (32-bit) with this utility and it consistently crashed MATLAB. I tried the same TDMS conversion utility on the very same TDMS file using R2009b (32-bit) and it worked fine. Unfortunately, I haven't had the time to debug what's going on with the newer version of MATLAB that would cause problems.

 

You also could try a different utility that is posted on MATLAB Central: http://www.mathworks.com/matlabcentral/fileexchange/28771-converttdms-v9

 

I had tried a much older version of that approach that didn't work with my TDMS files, but it looks like there have been some improvements made to this utility. It uses MATLAB to directly dig through the TDMS binary file rather than relying on DLLs, so it should behave well under 32- or 64-bit MATLAB. I would recommend giving that one a try.

 

-Mike

0 Kudos
Message 23 of 24
(1,035 Views)

Hello Martin,

Thanks for that great work. I was trying my luck with the matlab_tdm_example_sp2010 of NI which was unfruitful. Therefore I tried your code and am very happy about the result. Since my data contains date format channel properties, I found a small bug which I'd like to report.

Within the 'get channel properties' section, within the case 'DDC_Timestamp' you are calling the library function 'DDC_GetChannelGroupPropertyTimestampComponents'. This leads to Error -6207 // An invalid channel group handle was passed to the library.

It can be resolved by calling the right function: 'DDC_GetChannelPropertyTimestampComponents'.

I hope this may be useful to someone!

 

Furthermore I'd like to make a suggestion. In case you are using a collection of slightly differing TDMS files and want to sort these according to some properties, it may be unpractical to have properties assigned to a index of the structure, rather than having them assigned with the property name.

Therefore I changed your post processing sub function a little bit. I use dynamic variables to declare a properties name directly e.g.:

 

retStruct.(topLevelFilePropNames{i})=topLevelFilePropValues{i};

Instead of:

retStruct.property(i).name=topLevelFilePropNames{i};
retStruct.property(i).value=topLevelFilePropValues{i};

 

This may not be suitable for any case but make a very well searchable structure.

Thank you very much for this great piece of  work again and keep it up.

 

Lukas

0 Kudos
Message 24 of 24
(680 Views)