LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Close SubVI's Front Panel Sequentially?

Hello,

I'm new to LabVIEW. 

I'm trying to close the multiple SubVI's Front Panel sequentially but I didn't get the expected behavior. 

 

Expected behavior:

1. Main.vi -> Click "OK" Button - > SubVI "Middle.vi" Open -> Click "OK" Button from FP of "Middle.vi" -> SubVI "Lower.vi" Open.

2. Click "STOP" button from "Lower.vi" FP, it should close the the Lower.vi but "Middle.vi" should remain open unless we hit "STOP" button from "Middle.vi" 

 

Note: I kept "STOP" button Value change event as well as "Mouse Leave" Event to stop the VI.

 

Find the attached project. 

0 Kudos
Message 1 of 9
(3,195 Views)

Hi,

 

          I can't open your project because u have saved with the newer version of LabView. Get the reference of all the running subvi's and use "Abort VI" Invoke method.

0 Kudos
Message 2 of 9
(3,190 Views)

If you remove the mouse leave event in both subvis, doesn't it work as expect?

0 Kudos
Message 3 of 9
(3,179 Views)

@atul_ghumade wrote:

Note: I kept "STOP" button Value change event as well as "Mouse Leave" Event to stop the VI.


That Mouse Leave event is what is causing your problem.  From Middle.vi, you click OK which opens Lower.vi.  So your mouse is now on Lower.vi, which means it has left the pane of Middle.vi.  So now that event is queued up waiting for Lower.vi to complete.  As soon as Lower.vi is closed, the loop in Middle.vi iterates and handles the Mouse Leave event causing Middle.vi to also be closed.

 

My recommendation is to just not use the Mouse Leave event.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 9
(3,174 Views)

@crossrulz @majoris

Thanks for your response. 

Can't we do it using "Mouse Leave" event, because that's mandatory requirement for me. If it is possible then How to implement?  

Message 5 of 9
(3,140 Views)

I mean, of course you can keep it; you just can't have it close when the event occurs (set the boolean to False instead of True in the case). The whole issue is that the mouse leave event is closing the window.

 

But I can't understand why you want this event if you don't want the window to close. Why is it coded this way?

0 Kudos
Message 6 of 9
(3,114 Views)

Is the requirement to have the Mouse Leave Event in Middle.vi? I'd use it in Lower.vi so it closes when you leave it with the mouse and use the stop buttons for the others.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 9
(3,079 Views)

@

Yes That's mandatory requirement. The Opened Panel must close when user Taps outside.

We are making it for touch screen.  

0 Kudos
Message 8 of 9
(3,072 Views)

But a tap isn't Mouse Leave, it's a Mouse Down. If the Mouse Down's coordinates are outside the panel it should close.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 9 of 9
(3,051 Views)