05-28-2023 10:02 PM
When I run a vi file that imports python using python node, the following error occurs.
Python returned the following error:<class'SystemError'>D:\a\1\s\Objects\listobject.c:222:bad argument to internal function.
When I run python files alone, there's no problem. And I have verified that labview is compatible with python through simple examples.
May I ask why this kind of problem occurs? How to solve it?
Solved! Go to Solution.
05-29-2023 10:10 AM
@hallo77 wrote:
When I run a vi file that imports python using python node, the following error occurs.
Python returned the following error:<class'SystemError'>D:\a\1\s\Objects\listobject.c:222:bad argument to internal function.
When I run python files alone, there's no problem. And I have verified that labview is compatible with python through simple examples.
May I ask why this kind of problem occurs? How to solve it?
Can you post the LabVIEW code that is resulting in this error?
05-29-2023 10:36 AM
Hello, thank you very much for your reply. I'm sorry that I don't have any pictures at present, so I can't provide them for the time being. But the labview code is also very simple. The python node simply has a one-dimensional array attached to the return side to display data of type int32. The return type end is connected to an array of one-dimensional constants of data type int32. The other I/O terminals are not connected. I used lists in python programs and eventually converted the list to an array and returned the output. I don't know if it matters.
05-29-2023 07:57 PM - edited 05-29-2023 08:08 PM
Thank you.I've solved the problem. When using Labview's python node, the python program automatically converts a list to an array if it returns it, without any extra processing in my python code. After I removed the list to array code, the code in labview was displayed properly.