07-21-2011 07:23 PM
I am developing an application in which I call a number of Sub VIs which contain a number of event structures. I have a problem that when I call such a sub VI the control goes to that Sub VI and never returns to the main VI. I would like to return the control to the main after I close the fron panel of the called Sub VI. Does anybody have any solution for that?
Rgards,
Mansoor
Solved! Go to Solution.
07-21-2011 11:11 PM
You said you have event structures in these subVI's. Are they inside while loops?
You need to add an event case to handle the Panel Close? event which discards the event, stops the while loop, and then closes the subVI right before it ends.
07-22-2011 01:26 AM
Hi,
There are many ways to solve this issue. As Ravens says you use Panel Close Method to close your Sub VI.
There are some options in your VI Windows Appearance Property you can customize the VI properties as per your requirements.
As above image shows you can open your VI reference and define the properties as per your application requirement.
Thanks and Regards
Himanshu Goyal
07-22-2011 12:50 PM
Thanks Ravens,
Yes my event sturctures are inside while loops and the whole code is inside a main while loop. Is there any way that I can terminate that main while loop when I hit the close button on the top right of the window?
07-22-2011 12:56 PM
Yes.
As I said, create another event case that is the Panel Close? event. Wire a True boolean constant to the discard terminal. Wire a true constant from that case, out of the event structure to the while loop stop terminal.
07-22-2011 01:02 PM
Thanks Ravens,
I got it.
07-22-2011 02:35 PM
Thanks Himanshu,
I applied your techniqe. It works very well.