LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Python Node input parameter error <class 'TypeError'> bad argument type for built-in operation

Hello,

 

I'm using LabVIEW 2021.

 

I have a Python function which has two arguments.

 

startScan(counting_time, file_name)

 

I'm trying to call this function using the Python Node. I've tried two methods of passing the arguments:

 

  1. Two individual inputs of the appropriate data type (I32 for counting_time and string for file_name)
  2. Put the above two inputs into a cluster and fed that to a single input.

Both of these give me the same error: "<class 'TypeError'> bad argument type for built-in operation". Not sure what this error is about. 

 

The Python code itself is flawless as I have run it on its own.

 

Thanks in advance for your help!

0 Kudos
Message 1 of 3
(235 Views)

I had a similar error using a Python node, generally it is cause by a data type that can't be type casted to a LabVIEW data type (like a null value). Make sure what you think is a string in Python is really a string (Python is very loose with data type), you can use the str() function in Python before outputting the value (that was the cause of the error in my case).

 

Ben

0 Kudos
Message 2 of 3
(198 Views)

Thanks. I figured out what was happening in my case. It was a mismatch of number of return values. It's fixed now.

0 Kudos
Message 3 of 3
(184 Views)