DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Question abour Method:ChnPropValGet

The help example shows this:
 
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
0 Kudos
Message 1 of 4
(3,520 Views)

Hi jsmalley,

unfortunately the property "length" is not written into a TDM file.
But you might check for the property "minimum":

Dim

oMyDataFileHeader, oMyChnPropVal

Set

oMyDataFileHeader = DataFileHeaderAccess("d:\sp\hummel.tdm","TDM",False)

oMyChnPropVal = oMyDataFileHeader.

ChnPropValGet("[1]/1", "minimum")

If

IsNull(oMyChnPropVal) Then

Call MsgBox("Channel has length 0, contains only NoValues or is a text channel.")

End

If

Christian

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

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

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

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.

 

 

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