06-01-2010 07:35 AM
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
Solved! Go to Solution.
06-01-2010 07:50 AM - edited 06-01-2010 07:57 AM
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.
06-01-2010 01:04 PM
06-01-2010 01:43 PM - edited 06-01-2010 01:50 PM
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.