NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to run a do-while loop on the 2nd execution after a stop on failure occurs?

I am trying to use the Stop on Failure process model callback from the TestStand Examples.
If a step fails within a Do-While loop and the test is terminated, the second time the test is run (continuing to the Next UUT in the process model), the condition for the do-while loop is checked first before it ever enters the loop. This is incorrect because the Do-While loop should execute once and then check the "while" condition.
Also, If I was to stop the execution altogether and then restart the test (instead of continuing with the Next UUT), it runs the loop once, then checks the "while" condition.
 
I'm not sure if I am describing this clearly enough. The execution seems to flow like this:
 
Start test
Do
NumericTest step FAILS  -> terminate
Next UUT starts
While (condition is false and skips over Numeric Test step).
 
So it seems that TestStand thinks it's still within that Do-While loop on the second execution and whatever runtime variables are not reset correctly.
Is this a TestStand bug?  It happens in both TestStand 3.1 and 3.5.
Is there any way around this?
 
Thanks for any help.
0 Kudos
Message 1 of 6
(3,665 Views)

If it is what I think it is, it is a bug. Try unchecking Sequence Properties>>Optimize Non-Reentrant Calls to This Sequence and please tell me if that fixes it.

 

Message 2 of 6
(3,662 Views)
Yes, that fixed it.
0 Kudos
Message 3 of 6
(3,657 Views)

Thanks, that is what I expected. We will investigate further.

 

0 Kudos
Message 4 of 6
(3,653 Views)

This reply helped me debug an issue with 2013. I have a while loop and the offset was not resetting.

 

Is this expected behavior or is there indeed still a bug related to Optimize Non-Reentrant Calls

 

 

0 Kudos
Message 5 of 6
(2,654 Views)

Hi Erickey,

 

I am glad the workaround of disabling Optimize Non-Reentrant Calls worked for you! I haven't been able to reproduce this error on my end or find any information on a potential bug fix. Would you be able to post a small snippet of the code you used to produce this error?

 

Thanks,

ShaneK

0 Kudos
Message 6 of 6
(2,637 Views)