04-11-2018 08:48 AM
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.
04-11-2018 08:53 AM
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.
04-11-2018 09:04 AM
If you remove the mouse leave event in both subvis, doesn't it work as expect?
04-11-2018 09:08 AM
@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.
04-12-2018 12:09 AM - edited 04-12-2018 12:10 AM
@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?
04-12-2018 09:05 AM
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?
04-16-2018 02:05 AM
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
04-16-2018 02:57 AM
Yes That's mandatory requirement. The Opened Panel must close when user Taps outside.
We are making it for touch screen.
04-16-2018 09:40 AM
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