01-11-2011 08:20 AM
Hello everyone!
I am trying to read tdms files with Matlab. I have downloaded the matlab tdm example and i am able to retrieve DBL values but i can't read string data.
I have attached a test tdms file with strings. Can you please tell me how I could read it?
Thank you very much!
01-13-2011 03:51 AM
Hi,
Text channels in TDM and TDMS files cannot be read in MATLAB®.
You would have to convert the TDMS file to some other format (such as ASCII) and then import it into Matlab.
Regards,
Joseph
05-21-2013 01:56 PM
Joseph,
Is there a fundamental reason why text channels cannot be read or has it just not been implemented in the Matlab code? I've been trying to get the following function from the library working,
[int32, stringPtrPtr] DDC_GetDataValuesString(int32, uint32, uint32, stringPtrPtr)
I haven't had any luck yet, but I'm not used to calling DLLs from Matlab so I am likely making coding mistakes.
Thanks,
Erik
06-18-2014 04:58 AM
Hi Larson,
Did you ever find a solution to this?
I have have been able to use this function with the following code
% Get the number of available values [eCode,nValues] = calllib(libname,'DDC_GetNumDataValues',hChannel,iTemp); iStart = 0; % Get the string values iTemp = libpointer('stringPtrPtr',repmat({''},1,nValues)); [eCode,dValues] = calllib(libname,'DDC_GetDataValuesString',hChannel,iStart,nValues,iTemp);
However, the variable iTemp needs its memory deallocated using the TDMS function 'DDC_FreeMemory' otherwise matlab crashes.
So far, I have been unable to sucessfully deallocate the memory after reading the string values.