10-07-2016 09:15 AM
This should be fairly straight forward, but I have some VIs in my test sequence that come up as dialogs/pop-ups. The user can close these dialogs, but I want the test sequence to abort if the user does this. I have panel close setup as an event in the sequence that return a boolean value as TRUE. I want this trigger a manual abort in the test sequence, prefearable as a Post-Expression.
Solved! Go to Solution.
10-07-2016 09:30 AM
Hi,
You can use the Abort() Method to abort the execution, by inserting into the Post-Expression like this:
Step.Result.PassFail == False ? {RunState.Execution.Abort()} : {}
(You can change the "Step.Result.PassFail == False" for a boolean check on your returned value, if you so wish)
Regards,
Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)
Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor
10-07-2016 09:37 AM
I recommend using Terminate instead of Abort. Abort will kill everything and immediately exit, including the Process Model. Terminate will run your cleanup routine.
My 2 cents,
10-07-2016 10:25 AM
I agree with Jigg, I'd prefer Terminate as it works through the cleanups turning everything off nicely.
You can find a summary here: Terminating and Aborting Executions
If you still want to terminate via your Step Post-Expression, you could use:
Step.Result.PassFail == False ? {RunState.Execution.Terminate()} : {}
I hope this helps,
Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)
Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor
10-07-2016 01:13 PM
I used:
RunState.Execution.Terminate()
did exactly what we needed. Thank you for you both for your help.
10-07-2016 02:29 PM
Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)
Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor
10-24-2016 06:09 PM
A little more information if you end up needing it later down the road.
You will likely need to do a RunState.Exection.InInteractiveMode? and then call Runstate.Execution.TerminateInteractiveExection or RunState.Execution.Terminate
If your users never do interactive executions, then you can ignore this.