09-24-2009 10:28 AM
09-24-2009 10:59 AM - edited 09-24-2009 11:01 AM
You can just hide the VI in the FP close event (Set FP.State to hidden). See image.
Hope this helps,
Daniel
09-25-2009 07:38 AM
The root cause of this issue is an intended behavior of the LabVIEW runtime engine. If there are no VIs running and showing front panels, the engine exits. This is what causes your application to exit prematurely. You have several options, some of which have already been demonstrated.
09-26-2009 02:46 PM
Well, the last panel in a built application that closes, kills the entire application instantly. No chance to run some code after that, you can not go over start, you can not get any money for going over start, etc. etc.
The way I solve this is using the Panel Close? Filter event and returning false to refuse that event. I then schedule the normal state machine close state and let that run, which will deallocate any resources it may find necessary, close files and other refnums, stores data, etc. After that and having given all other parallel tasks (loops) in the diagram a chance to close, I close the FP programmatically using a VI server method node.
That close state can also be caused by other sources such as a quit menu event, some button value changed events, etc.
Rolf Kalbermatter