08-14-2014 03:43 AM - edited 08-14-2014 03:46 AM
Hi,
in Diadem 2012 I used the command DataFileHeaderAccess to access root properties of my TDMS files. The properties are in the lowest level (not in groups or channels). In 2012 my code looked like this:
Set oMyDataFileHeader = DataFileHeaderAccess("test.tdms", "TDMS", True) oMyRootPropVal = oMyDataFileHeader.RootPropValGet("Property_xyz") If (InStr(1, oMyRootPropVal, "search_string", vbTextCompare) > 0) Then ...
I don't understand how to use the new command. I tried different things, but nothing worked for me. For example:
Set oMyDataFileHeaderAccess = CreateDataFileHeaderAccess Set oMyDataStore = oMyDataFileHeaderAccess.Open(files(i),"TDMS", True) Call MsgBox(oMyDataStore.RootElements(1).Properties.Item(1).Name)
My properties don't appear in the branch RootElements(1).
oMyDataStore.RootElements(1).Properties.Count also returns the wrong size in my case.
Thanks in advance!
Karlheinz
Solved! Go to Solution.
08-14-2014 12:13 PM
Hi kawosch,
Try this in DIAdem 2014 and later:
Set TdmHdr = CreateDataFileHeaderAccess() Set DataStore = TdmHdr.Open(files(i), "TDMS", True) Set DataRoot = DataStore.RootElements(1) Set DataGroup = DataRoot.Children(1) ' first Group Set DataChannels = DataGroup.Children ' first Group's Channels MsgBox DataRoot.Properties("Property_xyz").Value
Brad Turpin
DIAdem Product Support Engineer
National Instruments
08-15-2014 02:36 AM
Hi Brad,
thanks a lot, that helped :-).
Karlheinz