NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TestStand Python Enum Type Refuses To Find New Path

Hello,

 

I created an enum from a Python type in a python module.

 

Unfortunately, no matter how I delete and recreate this enum, I get this error:

alexklrc_0-1762983239932.png

 

All of the windows that let me select the enum work correctly.

 

Using TestStand 2025 Q3 64 bit.

0 Kudos
Message 1 of 3
(99 Views)

It looks like this is any time that the parameter is configured inside my type palette, whether it be by using a step field, or by typing the full enum value.

alexklrc_0-1762985702423.png

 

Like, if I type Enums.ConnectionMode.FOUR_WIRE in the Step Settings inside the sequence, it works, but if I type the same thing in the Default Module of the custom step, it does not.

0 Kudos
Message 2 of 3
(82 Views)

Based on the behavior, I am guessing that the path to Python module which is configured with the Enum type is relative to sequence file.

 

To determine what Python path is configured for the TestStand Enum type, do the following: In the types view, for the TestStand Enum type, go to properties (by doing right click on the type) and go to 'Python Parameter Passing' tab in the dialog.

 

Let me know what path is configured for the Python module in TestSTand type properties and is it a relative path, relative to sequence file.

 

If it is relative to sequence file, following is the reason you are seeing this behavior:

When TestStand tries to load the Python module to convert TestStand Enum to Python Enum, it uses the Context in which it is used. When using the TestStand Enum in a step present in a sequence file, since the Context knows about sequence file, if using relative path, it searches relative to the sequence file too. In the case of Default Module of custom step type, since it is not attached to any sequence file, the Context does not search relative to any sequence file.

 

If the configured Python module path for Enum is relative to sequence file, you can do either of the following to ensure TestStand Enum to Python Enum conversion works in all the case:

  • Configure the Python module path in types view to use relative path, where path is relative to any of the TestStand search directory. Note: You can also add you own directory to TestStand search directory. You can use Configure >> Search Directories to understand what search directories are configured for TestStand.
  • Configure the Python module path in types view to use relative path, where path is relative to any of the Python search directory.To understand search directories of Python, use `sys.path` in the version of Python configured to be used in TestStand.
  • Use absolute path for the Python module in the types view.

-Shashidhar

0 Kudos
Message 3 of 3
(41 Views)