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 do I do this Post action?

How do I execute a step from the main sequence following the failure of a step in the sub sequence?
0 Kudos
Message 1 of 3
(3,172 Views)
Hi,

In the current implementation of step post action, there is no possibility to jump outside the scope of the sequence where the step resides. However, there is a workaround to this.
A possible solution is shown in the attached example.seq, and the whole "trick" is based on setting a "Custom" PostAction for the step, as follows:
Step.Result.Status == "Failed" && (RunState.Caller.RunState.NextStepIndex = Parameters.FailNextStepIndex || True)
The destination for "On Condition True = Go To Destination" must be "Cleanup", as we have to return from the subsequence first.

For more details, please have a look on the attached sequence file and run it in debug mode starting with MainSequence.

Hope this helps,
Regards Silvius

P.S. Rename the file by cutting the .txt extension.
Silvius Iancu
0 Kudos
Message 2 of 3
(3,150 Views)
Hi

It's me again, with a little correction!
The Custom expression has to be :
(Step.Result.Status == "Failed") && (Step.Result.Status == "Failed" ?(RunState.Caller.RunState.NextStepIndex = Parameters.FailNextStepIndex) : (RunState.Caller.RunState.NextStepIndex = RunState.Caller.RunState.NextStepIndex) || TRUE)

This way it will work also when the step Passes.

A new sequence file is attached here.

Regards,
Silvius
Silvius Iancu
0 Kudos
Message 3 of 3
(3,149 Views)