What is the easiest way to display the front panel of a sub vi when a user presses a button?
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"
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
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.
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