LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Good way to trigger exit event for VI's loaded in subpanels?

Sorry if this is a novice question, but I haven't gotten much traction searching for an answer the last couple days.

 

I have a setup that uses remote panels for an interactive "lab."  The panel loads a reentrant VI that is just a tab control, the front of which has a user/password/lab selection form, and upon proper credentials being entered tabs to one large subpanel.  This panel loads the selected lab VI, which is itself just a rudimentary VI with 2+ subpanels, each of which loads a specific instrument.  The instrument VI's are being held open by the subpanels, so that if the user closes the browser everything exits.  It all seems to work fine so far.

 

What I'm wondering is if there is a simple way to force a handful of commands/cleanup-actions before these instrument VI's leave memory.  One device in particular ramps high voltage on start, and I'd like to ramp it down as part of a cleanup step.  Is there an easy way to incorporate this with my setup?  If not, what's the best way fundamentally to handle something like this?  I'm far from an expert, but if there is a lot better way to design a setup like this I'd love to hear it. 

 

Thanks for any help.

0 Kudos
Message 1 of 5
(3,140 Views)

I have never used remote panels, so don't know if this would work, but it is worth a try.  In most applications, if you want to run a shutdown routine when you get a system close event, use an event structure and implement Panel Close? and Application Instance Close? events.  These events allow you to throw away the actual event and do an orderly shutdown.  Check out the LabVIEW help on event structures if you have never used them.  Good luck.

Message 2 of 5
(3,135 Views)

Thanks for the reply.

 

I actually have toyed with both the application close? and panel close? events.  Panel close doesn't seem to trigger off a subpanel (I think I read that in the help too).  Application close doesn't trigger because I have to keep the highest level vi's front panel open or the remote panel doesn't display anything, and for my purpose that interface has to be active 24/7, even if individual labs aren't in use. 

 

Maybe I should rephrase the question... is there any way to detect when a vi loaded in a subpanel is about to be taken out of memory because the subpanel is no longer viewing it? 

 

I'm thinking if not perhaps there is a way to detect if a VI is loaded in a subpanel with another independent VI, and when that VI sees that the instrument VI in question is no longer running (due to the subpanel closing) it takes the appropriate action, rather than integrating cleanup into the instrument itself....  Anyone have any experience with this?

0 Kudos
Message 3 of 5
(3,116 Views)

Interesting-

 

I seam to start a lot of my replies with that word lately---------

 

 

Is it only tab controls?   Or, can you duplicate this on other FP objects? <food for thought, >

.I don't use tabs on my main GUI's because of the need to use work-arounds to update objects via VI server refeances that go stale.......... Let us see your example and play with it.

 

other than that TABs are the devil's work!  like latching bools, they have magic under the hood, and may behave "properly" but, the P-nodes might have....errr.... "unintended" consequences. 

 

I avoid Tabs on GUIs (but I do have duct tape ready to wrap my head with... when a great explaination can be offered about what tab controls really do in the background)


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 5
(3,109 Views)

It would definitely be helpful to see your project and be able to see how you are configuring and coding.  Is there anyway that you can zip up the project and upload it onto the forum?

 

 

Jacob K
0 Kudos
Message 5 of 5
(3,080 Views)