NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

"Continue" post action

I have a step in a For loop whose post-action I want to Continue (i.e., jump to the End step of the For block and continue looping [as in the "Continue" step type]) or to Break (i.e., break out of the loop by jumping to the End step and then executing the next step [as in the "Break" step type, not as in breaking execution]).  Is this possible?

 

I tried to put a Continue or a Break step in a subsequence that gets called as a post-action, but that doesn't work because the behavior of the Continue and Break step types is scoped to the sequence in which they reside.  Is there any other way to do this?  To achieve the behavior of a Continue step, I can have a post-action destination of the End step (I can't think of anything equivalent to achieve the behavior of a Break step), but the steps I am trying to configure will be predefined as templates that are dynamically built into a sequence, and the end destination will not be known at edit time.

0 Kudos
Message 1 of 7
(4,561 Views)

I don't think there is any way to do it in one step, but you could insert a Continue step right after your test step and give it a precondition that will cause it to execute only in the case in which you want it to.

 

-Doug

0 Kudos
Message 2 of 7
(4,539 Views)

Is there a way to make another sequence (say, the calling sequence) Continue or Break?  I'm guessing no, since it looks like this functionality is buried in the engine, without any API.

0 Kudos
Message 3 of 7
(4,510 Views)

Hi Jsiegal,

 

Can you clarify your second question?  Do you want to continue a step in a for loop past the for loop from the calling sequence?

Peter T
Applications Engineer
National Instruments
0 Kudos
Message 4 of 7
(4,486 Views)

I have a Sequence Call step in "MainSequence" within a For loop (i.e., between a "For" step and an "End" step); I want a step in the Sequence Call's subsequence to Continue or Break the loop.  In other words, when the subsequence has finished, the next step of "MainSequence" will be the "End" Step, followed by either the "For" step (in the case of Continue) or the next step after "End" in the case of "Break".

 

More specifically, I'm looking for some function call that will cause the Continue or Break behavior without having to explicitly execute a "Continue" or "Break".  If the logic to perform the continue/break behavior were in a code module, my subsequence (or a Post-Step Substep) could call that code module.  But the logic is in the TS Engine, so I was thinking that maybe there is some TS API function that would do the same thing.

0 Kudos
Message 5 of 7
(4,483 Views)

I agree with Doug that the best way to do this is probably with two steps. I set up a For loop with a Sequence Call step and a Break step directly after it. For the Sequence Call, I have the post actions set so that if the subsequence passes, it jumps to the step after the Break, so the loop can continue. If the subsequence fails, it goes to the next step (Break step) and exits the loop.

 

This isn't as simple as having everything in one step, but it does seem to work for me at least. If you'd like to see this function added to the API, please feel free to post it as an idea on the TestStand Idea Exchange so that it can be considered for future versions of TestStand.

 

I hope that helps, and let us know if you have any further questions about it!

0 Kudos
Message 6 of 7
(4,468 Views)

Thanks, I didn't think it would be possible to do what I want.  I'd prefer to not add an extra step because it would mean that the sequence I am building dynamically will have a different number of steps than the configuration from which I am building.  I think I would be happy with Break and Continue PostStep Actions, but an API would be useful too.  I'll post some ideas on the Idea Exchange.

0 Kudos
Message 7 of 7
(4,465 Views)