LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Action to perform when closing a window?

I want to make sure an application closes the serial port it’s using when the window is closed using the red X in windows. Is there a way to perform some specific case or something similar when that button is hit before the window closes?

0 Kudos
Message 1 of 3
(156 Views)

copied from Reddit

 

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(147 Views)

Event Structure. The event you want to use is the <This VI>->Panel Close event. This will be triggered when you try to close the window. What I usually do is use the Filter Event version (has the ? at the end of the name). I then discard the event (stopping the closing of the window), stop the loop, and then do whatever extra clean up is required after the loop. I can then use the Front Panel->Close method to close the window if so desired.


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 3 of 3
(137 Views)