LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error on Python and Labview

Solved!
Go to solution

Hello,

 

I'm trying to run a python script with labview and i getting the following error:

Possible reason(s):

LabVIEW: There was an error in executing the specified function.
Python returned the following error: <class 'TypeError'>
bad argument type for built-in operation

I couldn't find a solution, could you help me?
I attached the VI and the VI already create the python file

 

leandrofeder_1-1731607965738.png

 

0 Kudos
Message 1 of 7
(263 Views)

Is 'table' a reserved keyword in Python?  Or a built-in function, as the error code indicates?

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 2 of 7
(241 Views)

I was trying to use it as a function call

leandrofeder_0-1732011223651.pngleandrofeder_2-1732011260733.png

 

0 Kudos
Message 3 of 7
(186 Views)
Solution
Accepted by topic author leandrofeder

You appear to be changing several columns of your data in python to type of integer. You then return that to LabVIEW; but you told LabVIEW the return value is  all strings.

 

PhillipBrooks_0-1732047609608.png

 


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

Message 4 of 7
(162 Views)

The Python node in labview is configured to have the environment as an input, fortunately. That said, I actually came across that particular stack overflow post not super long after posting this. I force removed and reinstalled pyproj, and the message doesn’t pop up anymore. Unfortunately, the command prompt pops up blank now, and labview still freezes, so evidently that wasn’t even the main issue

0 Kudos
Message 5 of 7
(137 Views)

@leandrofeder wrote:

I was trying to use it as a function call

leandrofeder_0-1732011223651.pngleandrofeder_2-1732011260733.png

 


I don't know that this is the issue, but it might be worth trying to call python 3.10 because python 3.11 is technically not supported by LabVIEW: 

 

https://www.ni.com/en/support/documentation/supplemental/18/installing-python-for-calling-python-cod...

 

 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 6 of 7
(119 Views)

That was the problem, thank you very much!

0 Kudos
Message 7 of 7
(81 Views)