DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

forloop

Solved!
Go to solution

Hi

can we use for loop to execute the code.

How channel names can be assigned to variable?

 

Call ChnConcat("[2]/[2]","[1]/[2]")

Call ChnConcat("[2]/[6]","[1]/[2]")

Call ChnConcat("[2]/[10]","[1]/[2]")

Call ChnConcat("[2]/[14]","[1]/[2]")

Call ChnConcat("[2]/[18]","[1]/[2]")

0 Kudos
Message 1 of 4
(3,930 Views)
Solution
Accepted by topic author Sajeesh

Hi sajessh,

 

try to use concatenate strings in the expression:

 

for i = 2 to 18 step 4
 
  Call ChnConcat("[2]/[" & i & "]" ,"[1]/[2]")
 
Next

 

This should work.

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

Hi sajeesh,

 

I prefer to use channel objects rather than channel string references, like this:

 

Set Groups = Data.Root.ChannelGroups
Set ToChannel = Groups(1).Channels(2)
jMax = Groups(2).Count
FOR j = 2 TO jMax Step 4
  Set FromChannel = Groups(2).Channels(j)
  Call ChnConcat(FromChannel, ToChannel)
NEXT ' j

Brad Turpin

DIAdem Product Support Engineer

National Instuments

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

Hi..

Thanks a lot....it works..fine

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