LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

show sub-vi front panel when button is pressed

What is the easiest way to display the front panel of a sub vi when a user presses a button?

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 1 of 6
(1,501 Views)

I've always used an event structure with the sub VI in the case there the button's value changes, right click the sub VI and make sure "Show Front Panel when called" and "Close after calling" are checked from the SubVI node setup. Or in the Sub VI properties -> Window Appearance, click customize and make sure "Show front panel" and "Close afterwards if originally closed"

0 Kudos
Message 2 of 6
(1,481 Views)

I want the sub-vi to always run and only show its front panel when the button is pressed.

 

Not only run when the button is pressed

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 6
(1,473 Views)

Well that's a totally different problem. How are you calling the VI in the first place? You could use reference, queues or a variety of other methods, just depends on what best fits your architecture I would say.

0 Kudos
Message 4 of 6
(1,464 Views)

This is how I tend to do this.

0 Kudos
Message 5 of 6
(1,378 Views)

I have a subVI that asynchronously shows results and even fitting progress at a leisurely loop rate. It always runs and exchanges data with the main VI via a multipurpose action engine. It shows on startup but It can be closed at any time with the [X]. OTOH, it can also be shown again by pressing "Show Spectrum" on the main VI.

 

If you show the windows again this way I would recommend to also make it frontmost, else it might pop underneath other windows, never to be seen. (Don't make it modal or floating unless you really want that, I don't!). Note that if I press "show spectrum" while the panel already shows, it will just pop it to the front.

 

Have a look at the image here to see how the main and sub panels typically look.

 

Here's a quick view into the code. configuration, and node setup

 

altenbach_0-1596295249909.png

 

 

0 Kudos
Message 6 of 6
(1,356 Views)