06-18-2012 08:51 AM
I found a problem with CVI 2010 SP1 reading built-in properties from a TDMS file.
The functions:
return error -6629 TDMS_PropertyDoesNotExist if these properites exist but are an empty string!
I think that this error should be returned only if the property really doesn't exist, not if it is an empty string.
I saw this using TdmsReader supplied example with one of my TDMS files.
Solved! Go to Solution.
06-19-2012 09:48 AM
Are you certain the property exists in the file? I can't reproduce the problem you described with the example code I've included below.
unsigned int len;
TDMSFileHandle file;
TDMS_CreateFileEx ("c:\\myfile.tdms", TDMS_Streaming2_0, TDMS_ByteOrderNative, 0, "myfile", "", "", "", &file);
TDMS_GetFileStringPropertyLength (file, TDMS_FILE_DESCRIPTION, &len); // No error is returned here and the output value of len=0, just as I would expect.
TDMS_SaveFile (file);
TDMS_CloseFile (file);
Jeff
NI
06-19-2012 09:49 AM
I saw the properties when I open the TDMS with the Excel viewer plugin
06-20-2012 06:16 AM
My files are quite old (TDMS 1.0 format), that I converted to 2.0 with this vi.
Could this be the reason?
Could someone confirm this behavior with TDMS 1.0 files?
06-20-2012 11:30 AM
Hi Vix,
Was the file created in CVI or LabVIEW? When creating the TDMS file in CVI, the name property is required or the TDMS_CreateFileEx will return an error. However, the TDMS Open vi (with the create option) does not require the name property to be set. So if the file was created in LV, then unless the name property was specifically created, then it does not exist. In the Excel plugin, if the name property does not exist, it will default to the actual file name (the name property does not necessarily have to match the file name).
Since you have access to LV, you can simply add this property yourself with the TDMS Set Property vi. It may also be good habit to always set the 4 standard properties when creating TDMS files in LV.
06-21-2012 01:03 AM
Hi D
I'm not sure because one of our customers sent me these files, but I think that they were created with LabVIEW.
Your explanation is very good: in the Excel sheet I saw the property names with empty values, but probably it's the behavior of the plugin