01-21-2021 03:54 PM
I have a couple of python functions that together use QT5 to generate image data, to be displayed in a 2D image within labview
In labview the python session is opened and held in a global variable. The VI that needs to run the python scripts is loaded into a panel. One python function is for initialisation, the other provides refreshed image data.
If I put the image refresh in a while loop and the init outside of the while loop, it doesn't run. If I put both in a while loop with case structure round the init function, and use a shift register initially set to 1 and cleared to 0 in the first iteration of the while loop in order to trigger the init once only (technically equivalent to the first scenario), it works but takes anything up to 20 seconds to run the Python code. The python code runs fine outside of labview and easily provides a descent frame rate.
Does anyone have any ideas what might be going on, or how to get labview communicating with python more efficiently?
01-22-2021 12:49 PM
It would be easier to see some actual code instead of ambiguous descriptions.
01-26-2021 11:15 AM
Here is a screenshot. I've moved as much over to python as possible, so that all labview has to do is run one python script to initialise some variables within python and then loop a script to refresh the image data. It currently takes ~5 seconds to run the loop and I am not even getting any output.
Any ideas what might be causing this?
01-26-2021 03:44 PM - edited 01-26-2021 03:44 PM
Truncated pictures are typically useless for troubleshooting.
I don't see anything that measures or paces the loop rate? How often does it need to be recalculated? How big are these blue arrays?
Earlier you said that the VI is embedded into another front panel. Does it work better if it is separate?
How is the rest of the code? e.g. What's the purpose of the sequence frame? What else is going on? How do you stop the loop?