11-17-2023 02:24 AM
Hellow
We are currently developing test sequences in TestStand that load DLLs developed in the C language. In order to configure the tests, we load the configuration of the instruments from an external file (JSON). However, each configuration has a different structure, so a Python program is responsible for processing the file to extract these configurations for TestStand. The problem is how to create a custom type based on the structure returned by Python. This needs to be done at runtime, this means the structure is not known until the sequence is executed.
Thank You.
11-17-2023 01:17 PM
Well…. Typedefinitions are not dynamic…. So they are probably no solution to your problem.
Not really knowing how to use the TS API in Python…. You should be able to create PropertyObjects from your code module, e.g. creating containers with containing objects as you desire.
yet… how do you want to use this dynamically created data? How does your TS code know how to interpret this dynamically/ arbitrarily composed structures?
11-17-2023 04:05 PM
What is your Python module returning to TestStand? Strings and Numbers?
If you are returning to strings and numbers to TestStand, you could certainly create a dynamic PropertyObject of Type "Container" using Expression steps. Then you can add whatever you want to this container (strings and numbers) including the info from the Python module.
11-20-2023 05:55 AM
Hi
Python returns a container. The structure of this container is unkown from teststand util the execution of my test sequence.
11-22-2023 02:02 AM
@ibtissem_2022 wrote:
Hi
Python returns a container. The structure of this container is unkown from teststand util the execution of my test sequence.
So.... if you want to baiscally be able to return kinda anything within this container, you should figure out a clever way of telling your TestStand sequence how to handle this anything.
12-07-2023 10:51 AM
Maybe 2 python calls, with the first one returning an enum or string describing the container structure for a 2nd call to use?
10-17-2024 11:48 AM
I have a very similar issue that I am trying to resolve. How were you able to solve this?
Thanks
Randy