From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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,942 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,940 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,917 Views)