NI TestStand

cancel
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.

 

Thanks! 

0 Kudos
Message 1 of 10
(3,662 Views)

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,

-Doug

0 Kudos
Message 2 of 10
(3,655 Views)

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
(3,650 Views)

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,

-Doug

0 Kudos
Message 4 of 10
(3,636 Views)

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
(3,625 Views)

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.

 

-Doug

0 Kudos
Message 6 of 10
(3,614 Views)

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
(3,611 Views)

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.

 

-Doug

0 Kudos
Message 8 of 10
(3,608 Views)

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
(3,606 Views)

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.

 

-Doug

0 Kudos
Message 10 of 10
(3,599 Views)