NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems passing arguments from teststand to python

Hi,

 

I am trying to run a python code with teststand but i am having type errors while executing the step.

 

For example, even the simple code below is throwing an error:

 

<class 'TypeError'>
'float' object is not callable

TypeError: 'float' object is not callable

 

Code:  

def test (num😞
    num=num+1
    return num

 

benjohnk_0-1729732320170.png

 

benjohnk_1-1729732333140.pngbenjohnk_2-1729732356674.png

 

0 Kudos
Message 1 of 3
(259 Views)

Please help out on how to solve this issue.

0 Kudos
Message 2 of 3
(258 Views)

benjohnk,

I was unable to reproduce the issue in TestStand 2024 Q4 release. You are using an older version of TestStand and the fix for the issue might have gone in after that release. I am not sure of exact release which fixed the issue.

 

Even though I haven't tried it explicitly, try the following possible workaround so that you can continue using the specific version of TestStand:

  • Create Numeric Local variables 'In' and 'Out'
  • In the pre-expression of the step, assign value of Parameters.In to Locals.In
  • Use Locals.In and Locals.Out as parameter values in your step
  • In the post-expression of the step, assign value of Locals.Out to Parameters.Out

 

-Shashidhar

0 Kudos
Message 3 of 3
(197 Views)