10-25-2007 11:22 PM
Dim oMyDataFileHeader, oMyChnPropVal Set oMyDataFileHeader = DataFileHeaderAccess(DataLibrPath & "Example.tdm","TDM",False) oMyChnPropVal = oMyDataFileHeader.ChnPropValGet("[1]/1", "Description") MsgBox oMyChnPropVal
With this example I get the MsgBox dialog of "Driving Time"
If I try to use the property "Length" instead of "Description" I get an error. " A global error has occurred" Are certain properties not available with this object/method?
I was intending to make sure a particular channel in a group had data before loading in the entire group with DataFileLoadSel
10-26-2007 03:44 AM
Hi jsmalley,
unfortunately the property "length" is not written into a TDM file.
But you might check for the property "minimum":
Dim
oMyDataFileHeader, oMyChnPropValSet
oMyDataFileHeader = DataFileHeaderAccess("d:\sp\hummel.tdm","TDM",False)oMyChnPropVal = oMyDataFileHeader.
ChnPropValGet("[1]/1", "minimum")If
IsNull(oMyChnPropVal) ThenCall MsgBox("Channel has length 0, contains only NoValues or is a text channel.")End
If
Christian
10-26-2007 09:18 AM
Hi jsmalley,
If this channel length check is really important to you, you can add your own custom property to each TDM file that records the number of values in each channel. There are a half dozen or so properties which DIAdem calculates at load time and displays in the DataPortal, and the "length" property is one of those.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
10-26-2007 09:51 AM
I was just looking for a way to avoid loading in groups that didn't have any channel data. For now I just load it , then immediately deleted it if the channel has no length.
if (ChnPropValGet("[" & GroupCount & "]/" & ChannelSet, "Length")) =0 then GroupDel(GroupCount)
Your right I could add the length when I create the TDM if I think the above will be slower in the long run.