NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Abort Command

Solved!
Go to solution

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.

0 Kudos
Message 1 of 7
(3,430 Views)

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

Message 2 of 7
(3,419 Views)

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,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 3 of 7
(3,415 Views)
Solution
Accepted by topic author SHentchel

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

Message 4 of 7
(3,405 Views)

I used:

RunState.Execution.Terminate()

 did exactly what we needed. Thank you for you both for your help.

0 Kudos
Message 5 of 7
(3,393 Views)
Spoiler
No problem - glad I could help!

Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)

Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor

0 Kudos
Message 6 of 7
(3,378 Views)

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.

Message 7 of 7
(3,192 Views)