03-04-2014 12:01 PM - edited 03-04-2014 12:18 PM
I am trying to move all of my flow channels to group 4. they are currently spread throughout several channelgroups.
Dim oMyChn
Dim oMyChannels
Set oMyChannels = Data.GetChannels("*FLOW*")
For Each oMyChn in oMyChannels
CallMsgBoxDisp(oMyChn.Name)
CallData.Move(data.Root.ActiveChannelGroup.Channels(oMyChn),Data.Root.ChannelGroups(4).Channels)
Next
I am getting an error stating that "the argument transferred to Item must be either a string or an integer"
Can someone help?
Solved! Go to Solution.
03-04-2014 01:56 PM
Nevermind.
I finally got it 🙂
Dim oMyChn
Dim oMyChannels
Set oMyChannels = Data.GetChannels("*FLOW*")
For Each oMyChn in oMyChannels
Call MsgBoxDisp(oMyChn.Name)
oMyChn.ChannelGroup.Activate
CallData.Move(Data.Root.ActiveChannelGroup.Channels(oMyChn.Name),Data.Root.ChannelGroups(4).Channels)
Next
03-06-2014 12:12 PM
Hi Everyone,
I'd like to recommend the following alternative syntax as easier to debug and faster performing:
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
03-06-2014 12:18 PM - edited 03-06-2014 12:39 PM
Thanks Brad.
I will adjust my script.