Quantcast
Channel: NI TestStand topics
Viewing all articles
Browse latest Browse all 6733

Teststand python adapter type casting

$
0
0

Hi all,

 

I'm migrating old .net framework code to python code which needs te be called from teststand. I noticed some differences in type casting between both teststand adapters (python and .net). For example with the .net adapter I was able to pass a teststand numeric constant (1000) to .net code which expects an uint32 without having to cast it specifically in teststand.

Now with the python adapter I need to cast the default teststand datatype (which is a 64-bit float) to an uint (1000ui64) to pass it as an integer to python. If I don't do this I get a float in python and the function errors.

 

In the past we never used any other numeric representation in teststand but the default one. The teststand documentation also recommends to use the default numeric representation for both int32 and uint32 values as they can represent all possible 32-bit integer values. It also states that teststand module adapters can automatically do the type conversion. 

( Link to Teststand docu source)

 

So is there a reason why this automatic conversion is not done for the python steps? Or am i missing something?

 

Thanks!

 

 


Viewing all articles
Browse latest Browse all 6733

Trending Articles