DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

channel sorting

Uperbound*

0 Kudos
Message 11 of 20
(2,196 Views)

hey,

 

you could do something like this:

 

dim group
dim channel

 

for each group in Data.Root.ChannelGroups
    for each channel in group.Channels
        Call Area.DisplayObj.Curves2D.Add("[1]/Time",group.Name&"/"&channel.name)
    next
next

 

 

Britton C.
Senior Software Engineer
National Instruments
0 Kudos
Message 12 of 20
(2,182 Views)

That did not work, I would prefer to just have a wild card for the number in the for section. like for i = 1 to -1 or something like that.

0 Kudos
Message 13 of 20
(2,180 Views)

for i = 1 to Data.Root.ChannelGroups.Count

0 Kudos
Message 14 of 20
(2,164 Views)

Thank you , I tried:

 

For i = 1 to GroupCount and that seems to be working.

0 Kudos
Message 15 of 20
(2,160 Views)

Is there any way to make these channels wild card?

For i = 1 To GroupCount

 

 

Call Area.DisplayObj.Curves2D.Add("[1]/Timesec","["&i&"]/U_FREXG")

Call Area2.DisplayObj.Curves2D.Add("[1]/Timesec","["&i&"]/B1COH0")

Call Area3.DisplayObj.Curves2D.Add("[1]/Timesec","["&i&"]/B1THC0")

Call Area3a.DisplayObj.Curves2D.Add("[1]/Timesec","["&i&"]/B1NOx0"

Like B1NOx* or &B1Nox&

I have analyzers in different positions, so they would not always be in position 0.

 

Thank you in advance.

0 Kudos
Message 16 of 20
(2,099 Views)

Hi REX,

You can use the "*" symbol anywhere in the channel path to allow wildcard matching.  DIAdem will display the first channel it finds that satisfies your wildcarded channel path.

Call Area.DisplayObj.Curves2D.Add("[1]/Timesec","*/U_FREXG")
Call Area2.DisplayObj.Curves2D.Add("[1]/Timesec","["&i&"]/B1COH*")
Call Area3.DisplayObj.Curves2D.Add("[1]/Timesec","["&i&"]/B*THC*")
Call Area3a.DisplayObj.Curves2D.Add("[1]/Timesec","["&i&"]/*B1NOx*"

This feature was not always in DIAdem, so if you have a particularly old DIAdem version you will not be able to use wildcard characters (* or ?) in the channel path.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 17 of 20
(2,096 Views)

We use 2014 version, and it does not seem to work, is there a particular version we would need?

 

Thank you.

0 Kudos
Message 18 of 20
(2,088 Views)

Hi REX,

 

I'm sorry, the wildcarding I described only works directly in a REPORT layout. I didn't notice that your script had an "Area" parent object, which means you're wanting to do this in VIEW.  In this case, you'll need to apply the wildcards in two steps: first find the channel, then assign that channel to the VIEW Area graph:

Set Channel1 = Data.GetChannel("*/U_FREXG")
Set Channel2 = Data.GetChannel("["&i&"]/B1COH*")
Set Channel3 = Data.GetChannel("["&i&"]/B*THC*")
Set Channel4 = Data.GetChannel("["&i&"]/*B1NOx*")
Call Area1.DisplayObj.Curves2D.Add("[1]/Timesec", Channel1.GetReference(eRefTypeIndexName))
Call Area2.DisplayObj.Curves2D.Add("[1]/Timesec", Channel2.GetReference(eRefTypeIndexName))
Call Area3.DisplayObj.Curves2D.Add("[1]/Timesec", Channel3.GetReference(eRefTypeIndexName))
Call Area4.DisplayObj.Curves2D.Add("[1]/Timesec", Channel4.GetReference(eRefTypeIndexName))

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 19 of 20
(2,081 Views)

Thank you, I appreciate your help.

0 Kudos
Message 20 of 20
(2,078 Views)