NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Activating "Close Execution" programatically

I'm using TS 2022 with the python adapter. I have an instrument that is accessed via a tcl/tk interface.

 

Even though I close the connection in python via the tkinter module, it does not fully release the driver if there is a terminated execution. So if I run the sequence, get the pass or fail dialog, and then choose to stop the execution, I am left with a terminated execution. If the operator at that point hits the "Test UUTs" button, the step to open a connection to the instrument will fail because it's being held up by the terminated execution.

 

Is there a way to programmatically do the same thing as clicking "Close Execution" on the interface does? Or perhaps even restart the python adapter?

0 Kudos
Message 1 of 4
(286 Views)

Hi,

 

I believe I kind of understand the issue, yet there are still some things which are relevant:

 

Where in your sequence do you initialize the driver session? (ClientSequence, ProcessModellCallback)

Where in your sequence do you close the driver session? (ClientSequence, ProcessModellCallback)

Which ProcessModel are you using?

Are you saying, that the execution terminates after the PassFail dialog?

 

Thanks for providing this information

0 Kudos
Message 2 of 4
(268 Views)

The driver connection is opened early in the MainSequence and closed in the Cleanup section. I'm using the sequential process model.

 

Closing code:

 

import tkinter

def close_tcl_session(tcl):
    tcl.quit()

 

I've also tried "del tcl" in place of "tcl.quit()".

 

Say the test passes. The operator then sees the PreUUT dialog box.

 

stephenb2_1-1776800623784.png

 

If they hit stop and then later try to resume by hitting "TestUUTs":

stephenb2_2-1776802420728.png

This will cause an error when opening the test equipment handle fails since the terminated execution you see blocks it. If the operator hits  "Close Execution" followed by "Test UUTs", it works.

 

This equipment uses a tcl interface, not visa, and there is nothing I can do about that.

0 Kudos
Message 3 of 4
(235 Views)

Interesting....

 

 

When you are using TestUUTs, can you run subsequent UUTs / subsequent runs of the same UUT?

What happens, when you are running your Sequence File without the ProcessModel?


The screenshot you have attached looks like you are using (a  variant of) the Simple UI. 
What I don't understand, is why closing the display a finished execution 

Oli_Wachno_0-1776862198134.png

leads to freeing ressources....

 

 

 

0 Kudos
Message 4 of 4
(200 Views)