01-08-2015 12:15 PM - edited 01-08-2015 12:18 PM
I have an X Control that launches VIs dynamically and loads them into subpanels. If I put this X Control on a VI front panel and that VI has its panel closed, but that panel close event is unhandled so LabVIEW takes the default panel close behavior, the exec state change never fires. If I reopen the VI however, it is stopped. Because of this, my shutdown user event which is sent in the Exec State Change event case never sends and my VI is left running in the background.
Of course, I know the panel event should be handled, but this is about robustness of my X Control, not the panel close event handling. Is there any way I can capture this specific case?
01-09-2015 11:06 AM
Hi Greg,
To better assist you in troubleshooting this, could you please provide your code and some screenshots of the behavior you are encountering?
Thanks,
Devon R.
Applications Engineer
National Instruments
01-09-2015 12:11 PM - edited 01-09-2015 12:12 PM
See attached. Notice when you open Example.vi and run it, you get a popup that the Exec State change fired. When you press the stop button, you get that pop up as well. If you hit abort, you get the popup.
Now, instead of doing all of the above, run and then just close the panel of Example.vi; You get no popup.
01-12-2015 01:30 PM
Hi,
Thanks for sending in the code. Have you tried implementing an event structure? With an event structure, you can set the event to, “Application Instance Close”, so that you can execute some code when a user executes the Quit LabVIEW function. Please see attached screenshots.
Devon R.
Applications Engineer
National Instruments
01-13-2015 10:04 AM - edited 01-13-2015 10:08 AM
@DevonR wrote:
Hi,
Thanks for sending in the code. Have you tried implementing an event structure? With an event structure, you can set the event to, “Application Instance Close”, so that you can execute some code when a user executes the Quit LabVIEW function. Please see attached screenshots.
Devon R.
Applications Engineer
National Instruments
This doesn't work because if you close an owning project but not LabVIEW, the refnum goes invalid. However, I got an answer from here that lets me know what I needed to.