NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Terminate All Threads

Solved!
Go to solution

Hi All.

I am running a main sequence calling sub sequences to perform tests on a product. While this main sequence is running I need to be monitoring a couple of DIO lines, and should either of these lines change state then all testing should cease. I have tried using a sub sequence call as a new thread to monitor the DIO. The new thread performs as expected but does not terminate execution of the whole sequence as i need i.e. the main thread (testing) continues.

 

Is it possible to terminate the main thread from a child thread or is there a better method to tackle this problem.

Using TestStand 2010

 

Thanks in advance

 

Ian 

0 Kudos
Message 1 of 9
(5,037 Views)

Try using "Engine.AbortAll"

Message 2 of 9
(5,031 Views)
Solution
Accepted by topic author IanR

Use

Engine.TerminateAll

 

Be aware if you Abort then you don't run any Cleanups. Always use the Terminate methods if you have to shut down this way.

Regards
Ray Farmer
Message 3 of 9
(5,024 Views)

Thanks for the responses guys. Not having used the API before it was a struggle to figure out how to use it. Eventually managed to figure it out and used the TerminateAll function which works fine.

 

Thanks again.

0 Kudos
Message 4 of 9
(5,015 Views)

Hi Ian,

Actually how do you call the API?

I tried to use terminateall from the expression, but it gives me error. "Evaluation error: you are trying to use the TestStand API method 'IEngine.TerminateAll'. You must use parenthesis to call a method."

0 Kudos
Message 5 of 9
(4,731 Views)

Toyan,

 

Try:

 

RunState.Engine.TerminateAll()

 

Let us know how it goes!

0 Kudos
Message 6 of 9
(4,724 Views)

Since there is only one execution involved you should also just be able to do:

 

RunState.Execution.Terminate()

 

-Doug

0 Kudos
Message 7 of 9
(4,721 Views)

 

Toyan,

 

Simply, change adapter type to ActiveX/Com and add action step type as shown in attached diagram.

 

 

0 Kudos
Message 8 of 9
(4,717 Views)

Thanks all.

i finally manage to terminate it.

i use the method as shown by Joe and it works perfectly.

 

i tried to write RunState.Engine.TerminateAll in post expression, but somehow it doesnt work. maybe that time i have conflict with the parameter value.

 

anyway..thank you all 🙂

0 Kudos
Message 9 of 9
(4,704 Views)