LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I bring execution control to caller VI when I close the called Sub VI's front panel?

Solved!
Go to solution

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

0 Kudos
Message 1 of 7
(3,065 Views)

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.

Message 2 of 7
(3,058 Views)

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.

Open Sub VI.JPG

As above image shows you can open your VI reference and define the properties as per your application requirement.

 

Thanks and Regards

Himanshu Goyal

Thanks and Regards
Himanshu Goyal | LabVIEW Engineer- Power System Automation
Values that steer us ahead: Passion | Innovation | Ambition | Diligence | Teamwork
It Only gets BETTER!!!
Message 3 of 7
(3,048 Views)
Solution
Accepted by topic author MansoorEE

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?

0 Kudos
Message 4 of 7
(3,034 Views)

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.

0 Kudos
Message 5 of 7
(3,032 Views)

Thanks Ravens,

 

I got it.

0 Kudos
Message 6 of 7
(3,030 Views)

Thanks Himanshu,

 

I applied your techniqe. It works very well.

0 Kudos
Message 7 of 7
(3,023 Views)