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: 

Terminate Pass/Fail Sequence Step

Solved!
Go to solution

Hi everyone, I have a step in my main sequence that runs an interactive dialog box to the operator.  It checks whether or not it receives communication from the slave device.  If for some reason the operator wants to "TERMINATE (ABORT" the dialog box I have an "ABORT" button on the front panel to allow them to do so.

 

I want this sequence step to behave as follows:

 

1. If COMMUNCATION = RECEIVED and ABORT BUTTON = NOT PUSHED, then the step status should = Passed

2. If COMMUNCATION = NOT RECEIVED and ABORT BUTTON = NOT PUSHED, then the step status should = Failed

3. If ABORT BUTTON = PUSHED while in the midde of running the step, then the step status should = Terminated

 

Right now I have the step set up as a Pass/Fail step which uses a boolean output from the VI.  My issues is I am having trouble with Item 3 above.  I am right now putting in the Post Expression for the step the following to handle Item 3:

 

Locals.VIAborted == True ? RunState.Engine.TerminateAll() && Step.Result.Status == "Terminated": ""

 

Sometimes, I do not see Terminated when the Abort Button = Pushed.

 

Am I handling this correctly or is there a better way to do this?

 

Thanks so much!

0 Kudos
Message 1 of 3
(4,363 Views)

Did you think about  race conditions ?  My first idea,when seeing the statement was: Could it be, that the Sequence is terminated  before setting Step.Result Status ? 

Message 2 of 3
(4,349 Views)
Solution
Accepted by topic author testdesign

That was it...Thanks mkossman!

0 Kudos
Message 3 of 3
(4,328 Views)