DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

I want to multiply several channels in a diadem script by a value through a loop. How do i do this?

all the examples i've seen use channel names to specify the channels but i want to use the channel number so i can loop through several. I can't figure out how to do this in vbscript
I've tried:
 
for i = 1 to 4
 
Call FormulaCalc(Ch(i) = Ch(i)*2)
 
next
 
using several variations of double and singel quotes with no luck. It works if i use the channel number instead of i but I want to be able to loop through a long list of channels to do the same calculation....any help??
 
thanks
 
0 Kudos
Message 1 of 2
(3,915 Views)
icefield,
 
You can try the following code:
 
DIM ChGrpIndex
DIM i
ChGrpIndex = 1
FOR i = 1 to 4
  Call FormulaCalc("Ch('[" & ChGrpIndex & "]/[" & i & "]') := 2 * Ch('[" & ChGrpIndex & "]/[" & i & "]')")
NEXT
Regards,

Song Du
Systems Software
National Instruments R&D
0 Kudos
Message 2 of 2
(3,901 Views)