11-30-2006 09:01 AM
11-30-2006 09:57 AM
Hello Olga,
do not select fixed number of loops in the loop options tab of the step properties, but select custom. You will find a set of expressions which can be defined and employed to dynamically define the number of loops to run.
Tab should look like the following:
1. Loop Initialization Expression
RunState.LoopIndex = 0 (If you want to start from 0)
2. Loop Increment Expression
RunState.LoopIndex += 1 (If you do always increment by 1)
3. Loop While Expression
RunState.LoopIndex < 10
Now define a local variable of type numeric with the name 'LoopCount' and use this through the expression browser to replace the value of 10. Should finally look like:
RunState.LoopIndex < Locals.LoopCount
Now you are almost finished and simply need to write a step in CVI which uses the lookupstring 'Locals.LoopCount' to transfer a loop count value from CVI to TS by calling the function 'TS Property Set Val Number'.
Hope this helps,
Regards,
C.L. - National Instruments Application Engineering
PS: Out of office for one week