07-24-2013 02:19 AM
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.
Solved! Go to Solution.
07-29-2013 07:41 PM
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
03-04-2014 09:03 AM - edited 03-04-2014 09:07 AM
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.
03-06-2014 12:04 PM
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