01-18-2012 12:26 PM
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
Solved! Go to Solution.
01-18-2012 05:50 PM
Try using "Engine.AbortAll"
01-19-2012 01:14 AM
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.
01-19-2012 04:01 AM
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.
04-17-2014 04:40 AM
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."
04-17-2014 08:18 AM
Toyan,
Try:
RunState.Engine.TerminateAll()
Let us know how it goes!
04-17-2014 09:14 AM
Since there is only one execution involved you should also just be able to do:
RunState.Execution.Terminate()
-Doug
04-17-2014 11:28 AM
Toyan,
Simply, change adapter type to ActiveX/Com and add action step type as shown in attached diagram.
04-17-2014 11:09 PM
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 🙂