DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Find/search GroupChannel/channel by code

Solved!
Go to solution

Hello,

 

I want to write function that search groupchannel/channel by pattern and gives the appropriate channels.

 

I can write function that loop all groupchannel/channel and check if the pattern contains in the groupchannel/channel name.

like search for : *Speed*

gives channels: * airSpeed*

                            *generalSpeed*

 

There is some DIAdem built in function that do it?

The same effect like the search channels windows above the data panel.(like windows 7 folder searching)

 

Thanks.

0 Kudos
Message 1 of 4
(5,320 Views)
Solution
Accepted by topic author OzShimon

Hi Oz,

 

Try this, it returns an ElementList of all the matching channels from all the groups.  You could alternatively put in a grouppattern/channelpattern as well.

 

Set MatchChannels = Data.GetChannels("*generalSpeed*")
jMax = MatchChannels.Count
FOR j = 1 TO jMax
  Msg = Msg & vbCRLF & MAtchChannels(j).Name
NEXT ' j
MsgBox Msg

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 2 of 4
(5,293 Views)

what format does that store the found channels in?

 

I want to do a search and then change the channel groups.

 

Call

Data.Move(Data.Root.ChannelGroups(found channel group).Channels("Found Channel"),Data.Root.ChannelGroups(4).Channels,1)

 

 

Basically, I want to move all channels containing the word "PRESS" to group 3 and all channels containing the word "FLOW" to group 4.  Right now they are scattered throughout different groups.

0 Kudos
Message 3 of 4
(5,041 Views)

Hi 2Pale4TX,

 

It sounds like this approach is what you want:

 

Set PressChannels = Data.GetChannels("*/*PRESS*")
jMax = PressChannels.Count
FOR j = 1 TO jMax
  Call Data.Move(PressChannels(j), Data.Root.ChannelGroups(3).Channels, j)
NEXT ' j

Set FlowChannels = Data.GetChannels("*/*FLOW*")
jMax = FlowChannels.Count
FOR j = 1 TO jMax
  Call Data.Move(FlowChannels(j), Data.Root.ChannelGroups(4).Channels, j)
NEXT ' j

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 4 of 4
(5,004 Views)