LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read custom properties in tdms

Solved!
Go to solution

Hi,

 

I'm trying to read custom properties in root of a tdms file using Matlab with nilibddc.dll. I found two problems.

 

(1) I can read the names of file properties only up to 643. They are the ones on the first two rows in the first sheet when opened in Excel. nilibddc cannot read the rest of the properties shown on 4th and 5th rows in Excel-opened tdms file.

 

(2) I can read the names of file properties with DDC_GETFILEPROPERTYNAMES, but how do I read the values of file properties?

 

Many thanks!

0 Kudos
Message 1 of 3
(2,462 Views)
Solution
Accepted by topic author Junghwan

Hi Junghwan

 

"(1) I can read the names of file properties only up to 643. They are the ones on the first two rows in the first sheet when opened in Excel. nilibddc cannot read the rest of the properties shown on 4th and 5th rows in Excel-opened tdms file."


The properties shown in 4th and 5th row are those of the 31 groups of your file.

I'm guessing those are only available at the group named "User Properties".

You can call DDC_GetChannelGroups to retrieve the channel groups of the file.

Then DDC_GetNumChannelGroupProperties like DDC_GetNumFileProperties will return the number of properties.

 

"(2) I can read the names of file properties with DDC_GETFILEPROPERTYNAMES, but how do I read the values of file properties?"


To retrieve the values of a propertyyou need to call DDC_GetFilePropertyType (DDC_GetChannelGroupPropertyType) to determine the type of the property, and then call the according read function:

DDC_GetFilePropertyUInt8
DDC_GetFilePropertyInt16
DDC_GetFilePropertyInt32
DDC_GetFilePropertyFloat
DDC_GetFilePropertyDouble
DDC_GetFilePropertyString

For string type properties, make sure, you resereved a buffer of according size (DDC_GetFileStringPropertyLength).

For date/time (DDC_Timestamp), call DDC_GetFilePropertyTimestampComponents.

 

Please refer to the help file named "nilibddc.chm" in the ".\doc" folder for further details.

 

Cheers

Stefan

Message 2 of 3
(2,419 Views)

Stefan,

 

Ah! they belong to "User Properties" group... I thought they are file properties because they are on the root page.

 

Thanks alot!

0 Kudos
Message 3 of 3
(2,389 Views)