08-14-2024 01:06 PM
I'm using LabView 2021 to score some images using a python neural network. I've created a main.vi where everything is initialized like a camera, some constant values, and it calls a sub vi called scoreImage.vi that creates a python session using the create python session block in the connectivity section.
I've successfully created the session using the node and ran my code in a separate VI from the main.vi. Every time a button is pressed the main vi calls the sub vi and creates a python session and does what it needs to do then it closes that session. I'm thinking this is wasting a lot of time since it has to open and close a session each time an img is scored. So I wanted to just create the python session at the start of the main.vi and pass that session through to the scoreImage.vi sub vi. Then close the session at the end of the main.vi.
Problem is that I don't know how to pass the python session through to another vi. Is that even possible? Or is there a better way of doing this?
I have to use the function form a python file to score the img regardless so a python session or something similar is a must.
Any help or advice would be greatly appreciated. If clarification or something else is needed lmk. Thanks
08-14-2024 11:54 PM
Check out the connector pane on the top right having the subvi's block diagram open. This defines your ins n outs.