From 12:00 AM CDT Sunday, October 17 - 11:30 AM CDT Sunday, October 17, will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

Showing results for 
Search instead for 
Did you mean: 

Multiple executions terminating when button is pressed in GUI

I created a modified OI that's run 3x; that is, the same OI is run as A.exe B.exe and C.exe.


These each call the same Sequence, but pass in a different Device to TS.  The three executions clearly share TS resources, but it all works perfectly.


Well, almost perfectly.

When the Terminate button is pressed in any of the three EXEs, it's killing all three TS executions.  I am 99% sure that I disabled the "Terminate All" button and only revealed the button for the specific execution (I will check that as soon as I get back to my workstation).  Assuming I did this, is it possible that calling the execution terminate button in the OI is killing all three?  Or am I crossing my wires in the Sequence somehow?


Also- I did not do anything special to the sequence.  It's the standard single model (non-parallel)- this was developed in a hurry and my customers wanted three separate EXEs to run, rather than one with multiple DUTs on different sockets.



0 Kudos
Message 1 of 10

Since these are separate processes, they are separate instances of the TestStand engine, so requesting a terminate in one should not have any effect on the others. Most likely there is some other explanation such as some code in the sequence.


Hope this helps,


0 Kudos
Message 2 of 10

If they are in different executions, what can I be doing to terminate all of them, instead of just one?


What is the command, within the TS framework, that Terminates All Vs just one?


Furthermore, it's when the user presses the Terminate OI button, not anything the code is doing.

0 Kudos
Message 3 of 10

When you press terminate, the executions jump to their cleanup code. If you have cleanup code that effects anything in the other executions that could be the source of the problem. There would have to be something getting shared between the executions, perhaps synchronization objects or instruments. There is an Engine.Terminate and Engine.TerminateAll method, but that likely has nothing to do with this issue if you are really running separate instances of the UI in separate processes. If you are running multiple executions within the same process then terminateall would terminate them all, but that does not sound like what you are doing unless I misunderstood you explanation.


Hope this helps,


0 Kudos
Message 4 of 10

Well, I double-checked the OI code, and the button correctly invokes the CommandKind_Terminate in the ExecutionView Manager, so that should not kill all of them.

I checked the Sequence file, and it looks like I have a GOTO step that, on a sequence failure, has a post-action that Goes to the "Terminate" case.  I suppose this might get called at run time when the button is pressed in the UI.  Would that Terminate call terminate all the executions?  Again, I am remote and can't get on the hardware today.  Also, this code gets called when there is a hardware failure, but it doesn't seem to terminate the others- so I doubt that's it.

0 Kudos
Message 5 of 10

CommandKind_Terminate should only directly affect the execution selected in the executionviewmgr. If it's affecting other executions it must be through some indirect means because of code in the sequences.



0 Kudos
Message 6 of 10

So just some more questions in an attempt to track this down...


1) When the Terminate command is made, the code finishes the current step and then moves to the MainSequence Cleanup?  Or does it end the current step and then execute the cleanups of all the sub-sequences that it's currently executing?

2) If I have a GOTO or a Post action that has a Terminate, would that TerminateAll, or just the local execution? 

0 Kudos
Message 7 of 10

1) termination causes the execution to jump to cleanup and as the execution returns up the stack to each caller, each caller's cleanup is also called.


2) Just the current execution.



0 Kudos
Message 8 of 10

Thank you.  So it's possible that depending on WHEN they hit the button, something in the current sub-sequence's CLEANUP might be triggering a TerminateAll.


Quick (at least, I hope so) Question- how would I programatically trigger a TerminateAll from inside TS?  I need to find where I am doing it!


(The customer asked that I disable the report, so I don't even have that to go on!)

0 Kudos
Message 9 of 10

I think the best thing to do is to set the station option to "Allow Break While Terminating" on the main tab of the station options dialog. Then set a break point in your cleanup and step through the sequence to see what is happening.



0 Kudos
Message 10 of 10