TestStand 2019 Help
»View Product Info
The Looping panel configures an individual step to run repeatedly in a loop when the step executes. Use the Loop Type
ring control to select the type of looping for the step. TestStand determines the final status of the step based on the
number of passes, failures, or loop iterations that occur. To loop on several steps at once, place the steps in a new sequence, create a Sequence Call step that calls the sequence, and then loop on the Sequence Call step.
The Looping panel contains the following options:
- Loop Type—Specifies one of the following types of looping for the step:
- None—TestStand does not loop on the step. This is the default value.
- Fixed number of loops—TestStand loops on the step a specified number of times and determines the final pass or fail status of the step based on the percentage of loop iterations in which the step status is Passed.
- Pass/Fail count—TestStand loops on the step until the step passes or fails a specified number of times or until a maximum number of loop iterations complete. TestStand determines the final status of the step based on whether the specified number of passes or failures occurred or whether the maximum number of loop iterations was reached.
- Custom—Customizes the looping behavior for the step. You can specify a Loop Initialization expression, a Loop Increment expression, a Loop While expression, and a final Loop Status expression. The following example code illustrates the order in which TestStand uses the loop expressions:
while (Loop_While_Expression == True)
- Record Result of Each Iteration—Adds the step result to the sequence results list after each loop iteration. TestStand also adds the final result it computes for the step loop as a whole if you have enabled the Result Recording Option on the Run Options panel of the Step Settings pane for the step.
- Loop Count—Use this section to specify the number of times to loop, as well as a stop expression TestStand evaluates after executing each step. This section is available only when you select Fixed number of loops or Pass/Fail count for the Loop Type.
- Loop Initialization Expression—The expression TestStand evaluates before looping. For the Fixed number of loops option, the expression is RunState.LoopIndex = 0.
- Loop Increment Expression—The expression TestStand evaluates before and after executing each step. For the Fixed number of loops option, the expression is RunState.LoopIndex += 1.
- Loop While Expression—The expression TestStand evaluates before executing the step. If the expression evaluates to True, TestStand executes the step. Otherwise, the looping stops. For the Fixed number of loops option, the default expression is RunState.LoopIndex < 10.
- Loop Status Expression—The expression TestStand evaluates to determine the status for the final cumulative result. For the Fixed number of loops option, the default expression is RunState.LoopNumPassed / RunState.LoopNumIterations < 1 ? "Failed" : "Passed"
||Note You do not have to use the Looping panel to cause an execution to iterate for a step. Instead, you can use the For, ForEach, While, Or DoWhile Flow Control step types or a Goto step to create a loop on a series of steps inside the sequence. You can also use the preconditions for the Goto step in combination with any number of variables to control the loop.
Flow Control Step Types
Run Options panel
Sequence Call Step