01-14-2013 03:33 AM
I use the DLL nilibddc of the matlab_tdm_example_sp2010.zip to convert TDMS files to Matlab data.
There I get the following problems when trying to get all property names:
A) Matlab crashes
I used the function "DDC_GetFilePropertyNames" to get a list of all file-properties.
This worked fine in Matlab and deployed Matlab Application on Win-32 System.
Executing the deployed Win32 Application on Win-64 System results in an segmentation fault
if the function DDC_GetFilePropertyNames was called before (when m-function calling DDC_GetFilePropertyNames exits).
Code-snipped:
p_numElements = libpointer('uint32Ptr',0);
err = calllib('nilibddc', Function_GetNumProperties, handle, p_numElements);
numProperties = p_numElements.value;
emptycell = repmat( {''}, numProperties+5, 1 );
p_FilePropNames = libpointer('stringPtrPtr', emptycell);
err = calllib( 'nilibddc', Function_GetPropertyAllNames, handle, p_FilePropNames, numProperties );
for ii=1:numProperties,
tempPtr = p_FilePropNames + (ii-1);
propertyNames{ii} = tempPtr.Value{1};
end
B) wrong return values of "DDC_GetFilePropertyNameFromIndex"
I tried to use the function DDC_GetNumFileProperties, DDC_GetFilePropertyNameLengthFromIndex and DDC_GetFilePropertyNameFromIndex
instead of the above solution.
But here the fuction DDC_GetFilePropertyNameFromIndex doesn't return the property-name (only the blank string).
Code-snipped:
numProperties = p_numElements.value;
for nn=1:numProperties,
err = calllib( 'nilibddc', Function_GetPropertyNameLengthFromIndex, handle, nn-1, p_numElements );
nameLength = p_numElements.value;
p_propertyName = libpointer('cstring', blanks(nameLength+1));
err = calllib( 'nilibddc', Function_GetPropertyNameFromIndex, handle, nn-1, p_propertyName, nameLength );
propertyNames{nn} = p_propertyName.Value;
end
01-15-2013 01:15 AM
To make it more precise:
A) worked fine with Win XP 32bit and has problems with Win 7 64bit and (!) 32bit.
B) works neither on Win XP nor Win 7.