From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

NI Teststand executing a python 3.6 module, python code updates not reflected in TestStand processing the python module

Solved!
Go to solution

Hi folks,

I'm trying to run a python 3.6 class module using NI TestStand 2019, python adapter. The Operation scope is Module, Operation type is Call Method calling the function in the class. I'm using a simple input numeric Local variable to pass a numeric value and capturing the return numeric type using another numeric local variable. 

 

My question is that if I edit the python code when the NI TestStand is open , either from an Python editor or as a text file from the TestStand Module tab, the code update is saved to the python codebase. However, the numeric output when executing the teststand execution doesn't correspond to the updated code, but rather the output is processed based on the initial code. It seems as if the python code is somehow loaded onto a buffer memory in the TestStand and it doesn't get updated  until restarted.

Eg. if the python module is return numout where numout = numin * 5. If I pass 1 from TestStand local variable to numin, I get 5. If I edit the python code as numin * 10, and pass 3 from TestStand, the return numout is still 15 (3*5 instead of 3*10 which should have been 30). 

 

Could someone please advise if this behaviour is expected and how to address it ? 

0 Kudos
Message 1 of 3
(1,062 Views)
Solution
Accepted by topic author LabViewTestDeveloper

Try pressing File » Unload All Modules after making the change. TestStand should abide by the load/unload options under the Run Options tab for a step, which is "Unload when the Sequence File is unloaded" by default, so TestStand is keeping the old version of the file in memory.

Hope this helps!

Trent

https://www.linkedin.com/in/trentweaver
0 Kudos
Message 2 of 3
(1,019 Views)

Thank you for the solution. It works 

0 Kudos
Message 3 of 3
(937 Views)