TestStand If Step Condition Not Evaluating Correctly When Called in a Loop

Updated Oct 29, 2024

Reported In

Software

  • TestStand

Issue Details

I am using a TestStand If statement in a loop. Each time I am dynamically changing the Conditional expression. For the first time, the conditional expression is evaluated correctly. In subsequent iterations, if the conditional expressions are dynamically changed it will not be evaluated.

Solution

This is due to code optimization done at the back end for If statement. The workaround is as follows :
1) Go to the previous step ( the one before the If step)
2) Add the following expression RunState.NextStep.EvaluatedConditionExpr = Nothing in the post expression as shown below :
image.png