NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TestStand call python function, change some strings in python function, but TestStand's result is the old string, not update

Solved!
Go to solution

Have a python function, be called by TestStand, and change the string in the python, run the TestStand, but TestStand's result is the old string, not update the new string.

Except close the TestStand software and restart it, the result will update to the new string.

Is there any other way to update changes in python functions in real time?

0 Kudos
Message 1 of 5
(980 Views)
Solution
Accepted by topic author Jmknode77

Any changes to the python file require TestStand to reload it. Typically, you can force it to unload by selecting File -> Unload all modules or use the Reload module option in Step Settings

 

santo_13_0-1675353535336.png

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 2 of 5
(948 Views)

Thank you for your reply.

By selecting [File -> Unload all modules] this method is solved this problem.

 

 

The method in the picture you replied has also been tried, but the new string has not been updated, this method may not work.

Message 3 of 5
(932 Views)

It is 2 years later and I have the exact same issue with changing python code modules and re-running teststand 2023 Q4 64 bit.  The use of the file>unload all modules does seem to force the reload of the python module the question remains as to why the "Reload Module and Prototype" button fails to work.  I have spent hours and hours figuring out that it seems not to work.  Why not just remove it?  Then, make the unload modules function run automatically, every time?  IS there something I don't get?  Am I setting up my python module incorrectly?

0 Kudos
Message 4 of 5
(47 Views)

Allow me to also add....

When you change the python module to add a new function and save it,  then add a TestStand step that references the new code, TestStand pick up the new methods to be used in the step.  It is when you execute that sequence that it will say that there is no reference to that method in the class.  It is like it knows it is there for editing but not for execution.

0 Kudos
Message 5 of 5
(46 Views)