03-08-2010 01:22 PM
I'm trying to set For Loop to replace 1,2,3,..., but have a trouble to call ChnDiv with arguments.
Can you show me how to replace 1,2,3,... with variable in ChnDiv function?
Thanks,
Alexander.
Call ChnDiv("[1]/In RPM","[1]/Out RPM","/Ratio") '... Y,Y1,E
Call ChnMove("[34]/Ratio",1,27) '... SourceChn,TargetGroupIndex,TargetChnIndex
Call ChnDiv("[2]/In RPM","[2]/Out RPM","/Ratio") '... Y,Y1,E
Call ChnMove("[34]/Ratio",2,27) '... SourceChn,TargetGroupIndex,TargetChnIndex
Call ChnDiv("[3]/In RPM","[3]/Out RPM","/Ratio") '... Y,Y1,E
Call ChnMove("[34]/Ratio",3,27) '... SourceChn,TargetGroupIndex,TargetChnIndex
Call ChnDiv("[4]/In RPM","[4]/Out RPM","/Ratio") '... Y,Y1,E
Call ChnMove("[34]/Ratio",4,27) '... SourceChn,TargetGroupIndex,TargetChnIndex
Call ChnDiv("[5]/In RPM","[5]/Out RPM","/Ratio") '... Y,Y1,E
Call ChnMove("[34]/Ratio",5,27) '... SourceChn,TargetGroupIndex,TargetChnIndex
Call ChnDiv("[6]/In RPM","[6]/Out RPM","/Ratio") '... Y,Y1,E
Call ChnMove("[34]/Ratio",6,27) '... SourceChn,TargetGroupIndex,TargetChnIndex
Call ChnDiv("[7]/In RPM","[7]/Out RPM","/Ratio") '... Y,Y1,E
Call ChnMove("[34]/Ratio",7,27) '... SourceChn,TargetGroupIndex,TargetChnIndex
Solved! Go to Solution.
03-09-2010 02:12 PM
Hi Alexander,
Here's one way to do it:
FOR i = 1 TO 7
NewChannel = ChnDiv("[" & i & "]/In RPM", "[" & i & "]/Out RPM", "/Ratio")Call ChnMove(NewChannel, i, 27)
NEXT
Brad Turpin
DIAdem Product Support Engineer
National Instruments