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
(7,440 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
(7,431 Views)
Solution
Accepted by topic author 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
(7,413 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
(4,683 Views)