NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing of arguments to Python script

Hi,

 

Working throught the following tutorial i'm comfronted with a problem using the 'Argument Expression' field to pass arguments to a called python script.

http://www.ni.com/tutorial/8847/en/ 

 

It has been raised as a topic before (see these 2 links) - but doesn't seem to have been explained/fixed..

 

https://forums.ni.com/t5/NI-TestStand/Tourbleshooting-passing-arguments-to-scripts/td-p/3099661

https://forums.ni.com/t5/NI-TestStand/Python-Argument-not-passed-through/td-p/3358030

 

I'm using:

TestStand 2018

Python 36-32

 

My python script file extension type is correctly associated to the interpreter. But it doesn't pass the arguments ..

Why is this?

 

0 Kudos
Message 1 of 3
(4,256 Views)

correction: TestStand 2016

0 Kudos
Message 2 of 3
(4,239 Views)

Hello,

Sorry to just Jump into your thread like that. I have been working on almost the same project trying to get Data from TestStand to Jupyter Note Book. I have tried to follow the steps from http://www.ni.com/tutorial/8847/en/   but it does not work. when I use the call executable, all I get is a window with my Jupyter code. I don't get any results from theTestStand output window either. Below I have modified the Python code to work in Jupyter.

step #4 of the tutorial

#Get input as a list
numbers = input('Enter numbers: ')

total = sum(int(c) for c in numbers)
print("total_Sum:", total)

 

Step #3 of the tutorial just reading the data from arguments expression

import sys

#Iterate through each element and get data
for n in sys.argv:
print ("total_Sum:", n)

step# 4Error

I don't think I am pointing tho the Argv data?

total_Sum: C:\Users\rata\Anaconda3\lib\site-packages\ipykernel_launcher.py
total_Sum: -f
total_Sum: C:\Users\rata\AppData\Roaming\jupyter\runtime\kernel-357edb9f-22fb-46ff-91e4-272bc740f56d.json

 

Is it even possible to access Data through Jupyter? 

Any help will be greatly appreciated.

 

Thanks

WinnieWanda

0 Kudos
Message 3 of 3
(4,149 Views)