DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

CreateDataFileHeaderAccess (Diadem 2014)

Solved!
Go to solution

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

0 Kudos
Message 1 of 3
(5,001 Views)
Solution
Accepted by topic author kawosch

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

0 Kudos
Message 2 of 3
(4,976 Views)

Hi Brad,

 

thanks a lot, that helped :-).

 

Karlheinz

0 Kudos
Message 3 of 3
(4,956 Views)