07-23-2020 12:11 PM
The problem occurs when I am attempting to run a Python Node in my while loop. When I pass in the correct input (an image file path) into the Python Script via the Labview Python Node, everything works fine; python executes, returns my image, and the while loop repeats.
If I do not input a correct file path, the Python script returns an error, as expected. However, the issue arises when, with the while loop still running, I re-enter a correct image file path. The Python Script does not attempt to run again with the new file path. It appears that the Python Script simply stops executing once it encounters its first error.
What I would like to happen is that the Python Script would continue to run as normal for the next loop, and ignore the previous error.
What I've tried so far is to add an error handling to my Python script, where if the image can not be found, it would execute a sys.exit() line of code, ending the code. However, the Python Node in Labview still reads the sys.exit() as an error, and consequently stops running during the next loop.
Is there a simple way to solve this issue?
UPDATE: It appears that the Python Script still continues to execute in the next loop even if there was an error. However, it appears that it will only do this for about ~15 loops before completely exiting the Python Script and refusing to run again until rebooted. Need to prevent the Python script for quitting.
Attached is code.
07-23-2020 12:47 PM
(Sorry, just stabbing in the dark. I am sure an expert will chime in)
07-23-2020 03:24 PM
Thanks for your reply.
I've attached the missing VI. IT simply takes a 3-axis image and converts it into a displayable 2D image and IMAQ image. The other missing one (one below) is simply for measuring the loop speed and can be removed.
The memory does not change.
In this example, it is the same image. However, this is just a test code. In my actual code, it would be getting a new image file path every run.
Good note. I've made that change.
My main question is why Python is refusing to run in future iterations after passing an error? My guess would be some sort of timeout in Python where if it keeps returning errors after a given time (or number of runs), it simply gives up and exits the module all together.
07-19-2023 03:24 PM
This issue has been fixed in LabVIEW 2023 Q3.