LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Application Instance Close? Event (ie File->Exit) from Sub-VI

I have a main application that allows the user to load either of two sub vis via front panel button click. When the user is finished with the sub-vi the intent is that they can exit the sub-vi and it will return them to the main application VI. In the sub-vis I am handling the "Application Instance Close?" and "Panel Close?" events in an Event Structure where I discard either of those two events and then terminate the sub-vi while loop to gracefully close the sub-vi.

 

I am seeing an issue where if you select File->Exit in the sub VI it does not see an Application Instance Close? event in the sub-vi. If you then click the Panel Close? event (Windows Red X) in the sub-vi it will close the sub-vi but then it will propogate the original Application Instance Close? event you fired in the sub-vi to the main application so it then closes the main application. 

 

Is this normal behavior for sub-vis when triggering the Application Instance Close? (File->Exit) event? It doesn't make sense to me why this event would not close the sub-vi but propogates through to closes the main application VI after it returns instead. To me no matter what window you are in you should be able to select File-> exit and it should close that window without closing the parent application.

 

I have attached an example. 

Download All
0 Kudos
Message 1 of 2
(3,587 Views)

File -->  Exit by definition means Exit the application.  File -->  Close means close the subVI.

 

You should probably hide the menu in the subVI, or build a new menu that only has items that are appropriate for you subVI.

0 Kudos
Message 2 of 2
(3,578 Views)