LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Loading a SubVI in a main panel permanently

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?

 

0 Kudos
Message 1 of 6
(468 Views)

What benefit does a statically loaded VI inside a VI provide?

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 2 of 6
(450 Views)

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?

0 Kudos
Message 3 of 6
(442 Views)

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:

  • Develop your code into more of a full application instead of trying to operate in the "quick and easy" mode. OR,
  • Add some kinda janky code that, right before stopping, takes the subVI out of its embedded subpanel, shows its front panel manually, and brings it to the front.  OR,
  • Tell us a lot more details about the full task you're trying to accomplish instead of this one small part of it so we can give better advice.
Message 4 of 6
(395 Views)

@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. 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 5 of 6
(370 Views)

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.

0 Kudos
Message 6 of 6
(350 Views)