08-26-2018 09:43 PM
Now I have a *.py file, and it contains many functions that I have already wroten and tested. next step I want to call the functions from TestStand, and analyze the results. How can I tranfer the parameters between python function and TestStand Locals or Parameters?
Solved! Go to Solution.
08-27-2018 08:41 AM
Hey,
How are you calling your python script from TestStand? Are you using the Python Step Types or are you building an executable and calling that from TestStand? What is the current issue that you are seeing?
If you're using the Python Step Types, the mapping between Python data types and TestStand data types is as following:
This is also outlined in the Python Step Types in TestStand help.
08-27-2018 09:30 AM
Thanks a lot for the reply.
I only have the licence for NI Software Pack 2012, so still stuggle with the TestStand 2012, namely using Call-executable steps in TestStand. I read the doc "calling scripts from teststand..." and tried the example in Web, I am guessing that only Strings can be transferred between TestStand and Python .py files, is that correct?
I have experience calling VIs from TestStand, but recently I wanted to intergrate Python with TestStand and got no examples showing how to do this. When I try to return some parameters from Python Fcn, how can I get its value in TestStand, especially Python List and Dict?
In the file attached, I already have many Fcns wrotten. How can i use it in my TestStand Sequence file without save them separetely into many .py files and not only can use the print method to trans the String Paramters, but also return method or other method to trans Python List and Dict?
looking forward for the reply, Thanks.
08-31-2018 01:05 PM
It is not possible to do what you are asking to do. Yes, you can only pass ASCII characters with the Standard In and Out, so you would have to develop an interface for your python code that could serialize the dictionary object that you're passing between TestStand 2012 and your module. This is essentially what we have implemented for our custom python step types that support TestStand 2014 and later.
09-06-2018 09:25 AM
Thank you again for the reply. In the end, with the help of Python "import re module", I have realised my goal, but not so convinient. I will also try TestStand 2014 or later with the TS python module and figure out whether it works.