NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How does TestStand read a Python class instance

Solved!
Go to solution

I am using:

Python 3.12.10 (64-bit)

TestStand 2025 Q2

 

I have a main Python class that instantiates another Python class which consists of multiple property setters/getters. I have overridden the __getattr__(); to check if a property node exists in the 2nd class and then call that property directly, in the main Python class so that I can call the setters/getters in the secondary class directly, but TestStand does not see these property nodes and as such I cannot call them from TestStand. I have also extended the __dir__() method to add the properties within the 2nd class but unfortunately both of these overridden methods are runtime or dynamic, so they are not seen when loading the Python class. This all works flawlessly within Python.

 

I have yet to try inheritance to see if that exposes the property nodes of the inherited class. Unfortunately, I could have 10-15 inherited classes which causes another set of issues.

 

I am hoping to avoid creating objects for each of the different classes since it is painful to maintain them all and was hoping to be able to expose the property nodes from classes instantiated from a single class instance.

 

I am not sure that this is even possible; from a TestStand perspective, without using multiple inheritance.

 

Thanks

0 Kudos
Message 1 of 3
(555 Views)

I have also tried single and multiple inheritance and the properties in the parent classes do not show up in TestStand. The Python code can call them but I have no way to access them from TestStand.

 

Any ideas?

0 Kudos
Message 2 of 3
(530 Views)
Solution
Accepted by topic author RGSchmidt

This was resolved by working with NI ... the jedi library needs to be installed.

0 Kudos
Message 3 of 3
(462 Views)