07-18-2024 08:30 AM
I'm facing an issue with loading a subVI onto a main VI front panel. Whenever the main VI stops running, the subVI disappears from the front panel. I need the subVI to stay visible even after the main VI has stopped. How can I achieve this?
07-18-2024 09:25 AM
What benefit does a statically loaded VI inside a VI provide?
07-18-2024 09:49 AM - edited 07-18-2024 09:53 AM
I have no idea why you posted this in the Labwindows/CVI forum. Seems to be a LabVIEW question, right?
I will move it to the right place.
And I agree with Santosh. What's the point?
07-18-2024 11:56 AM
What you want to do isn't really possible the way you've described it, as the other posters are basically saying as well.
I think what is happening is that you are at a sort of "transition point" in working with LabVIEW.
LabVIEW has the ability to both be a "quick and easy" way to run a fast experiment or get some very basic automation going. It also has the ability to create full applications supporting all the features you'd expect in a full application.
With the first one, you generally make one VI, possibly a subVI or two, and then run it, it stops, and you can see your results on the front panel after it stops. Maybe you do some "cheats" where you press the "Abort" button when you want to stop instead of writing proper code to exit programmatically.
With the second one, you generally make dozens, hundreds, or even thousands of VIs, and when you run a test and finish it then saves the results to disk, to a database, or has them displayed on screen in a special screen, and then without stopping the program you can go back to running another test or whatever.
So what it sounds like is that you're trying to mix these two. You have a program that's complex enough that you're embedding a VI inside of another VI (presumably in a subpanel, though you don't mention it) but you're still trying to keep it simple by not writing code to either save the output of the embedded VI somehow or hold it on screen while the program continues.
So I think you need to do one of the following:
07-18-2024 05:55 PM
@llaala wrote:
I'm facing an issue with loading a subVI onto a main VI front panel. Whenever the main VI stops running, the subVI disappears from the front panel. I need the subVI to stay visible even after the main VI has stopped. How can I achieve this?
Catch the Main front panel stopping and call the "show vi front panel" method on the sub vi that you want to still be visible.
07-18-2024 09:38 PM
When the VI is stopped, it is back in edit mode, so what's the point of having a panel still embedded?
If this is started and stopped by the end user, the top-level VI should be designed as a proper state machine, where one state is idle. It should run when opened and close when done. The situation you are trying to avoid should never even happen.