NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use Loop Index in an expression?

HI,
 
I would like to use the loop index in an expression (for pre-condition as an example).
 
Reading        RunState.LoopIndex                           gives 0
Reading        RunStat.Root.RunState.LoopIndex    gives 0
 
I expected to see there the actual loop number (which was 1,2....).
 
Also, is there a way to obtain the number of fixed loop set for a specific test?
 
Thanks
Rafi
0 Kudos
Message 1 of 3
(2,923 Views)
Rafi -
Take a look at table 3-4 Order of Actions that a Step Performs in the Reference manual.  The precondition is evaluated once and is evaluated before any loops are executed.  I am not aware of any way to precondition any of the individual loops that are executed.
Scott Richardson
0 Kudos
Message 2 of 3
(2,921 Views)
Rafi,

As Scott pointed out, you could not use the Loop Index in a precondition.  If you need that much control over your loops, I would suggest using loop step type, either a For Loop or While Loop.  This would provide you complete control over the Loop index and size for the loop.

If you have any questions, feel free to reply.

Thanks,

Tyler T.
0 Kudos
Message 3 of 3
(2,898 Views)