LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bringing SubVI to the Front

Solved!
Go to solution

I'm developing an interface for monitoring experiments but require a separate VI to control pump hardware. The problem is I implemented the pump VI as a subVi is called from the monitoring interface with a button press. After calling it, I want upon another button press to bring the pump VI to the front if opened, if not I'd like to reopen it.

 

Thanks  

0 Kudos
Message 1 of 4
(5,271 Views)

here is a way. Make sure you have your subVI properties set to "open front panel when called" by pressing cntl+I -> window appearance. You only need one button with this. If the front panel is already open, it moves the fp to the front. If it's closed, it calls the VI.

 

Note that if you have error wires going into your subVI, it wont react to any front panel activity from your main front panel while it is open if you open it via this method because of data flow. It will wait for the error cluster to return from the subVI before anything else happens. If this is the case, you will need to dynamically call the VI using an invoke node and the Run VI method. You would then put that in the false case instead. Should be straight forward though. This should give you an idea at least.

 

Message Edited by for(imstuck) on 06-01-2010 07:57 AM
Message 2 of 4
(5,261 Views)
This seems to only work if the sub VI is not yet running. An odd situation occurs where if the sub VI is opened manually without using the parent VI, and ran, the button press will bring the sub VI to the front. However if the subVI is initially called using the parent VI, any button press thereafter is unresponsive. 
0 Kudos
Message 3 of 4
(5,229 Views)
Solution
Accepted by topic author jhn.nguyen

I guess I misrepresented what I said earlier. It doesn't matter if you have an error wire or not. This is happening because your main VI will not continue executing until your subVI has finished. Run with highlight execution, you will see. You will have to call your VI using an invoke node like so and also an invoke node for the method fp.open (not shown). set wait until done to false.

 

 

 

Message Edited by for(imstuck) on 06-01-2010 01:44 PM
Message Edited by for(imstuck) on 06-01-2010 01:50 PM
0 Kudos
Message 4 of 4
(5,218 Views)