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 Execution from Pop up message button

Solved!
Go to solution

Hi,

I would like to ask..how to terminate an execution from a pop up mesage button.

There is a select statement and on it there are 2 buttons.

press Ok to continue

press Terminate to terminate.

 

but i cannot use RunState.Execution.Terminate in the expression of Terminate button.

I tried to make the "Terminate Execution" on the Post Action but it did not work. It still proceed the steps on the MainSequence.

 

please help.

 

Thank you.

0 Kudos
Message 1 of 4
(5,852 Views)

@toyan wrote:
[...]

but i cannot use RunState.Execution.Terminate in the expression of Terminate button.

[...]

What does that sentence tell us?

 

You can enter a post-expression in your message popup step similar to this:

Step.Result.ButtonHit==2?RunState.Execution.Terminate():False

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 4
(5,843 Views)
Solution
Accepted by toyan

Hi Norbert,

I tried that you suggested earlier but no luck.

so I use ActiveX to use the TerminateAll API and it works. 

 

thank you 🙂

 

Message 3 of 4
(5,825 Views)

Just in case anyone else runs across this, you can use this post expression to get Button 2 to terminate the sequence:

 

Step.Result.ButtonHit==2?RunState.Execution.Terminate():0

 

It won't work if you have Step.Result.ButtonHit==2?RunState.Execution.Terminate():False as in Norbert's example above because Terminate() returns a numeric and False is a Boolean.  You'll get a runtime type conflict error.

Message 4 of 4
(3,095 Views)