07-31-2020 03:39 PM
What is the easiest way to display the front panel of a sub vi when a user presses a button?
07-31-2020 04:38 PM
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"
07-31-2020 04:45 PM - edited 07-31-2020 04:46 PM
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
07-31-2020 05:10 PM
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.
08-01-2020 02:59 AM
This is how I tend to do this.
08-01-2020 10:24 AM
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