LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Detecting Window Closure

After having called by reference a non-blocking vi which displays a message on its front panel, and then immediately returns without closing its window, is there a way to detect if the user has closed that window, whether by a property node connected to that VI's reference, or other means?

0 Kudos
Message 1 of 5
(1,175 Views)

FP Window.State could work but it sounds awfully backwards to not have the VI itself manage (and close) its front panel. If you need the VI stay on screen beyond displaying its message while not blocking the caller, you should launch it asynchronously.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 2 of 5
(1,148 Views)

How quickly does the caller needs to know? You can occasionally (e.g. once per second) poll the state and maybe that's sufficient.

 

You probably could use the panel close event in the subVI to fire off a value change via property node referencing an LED on the main VI. If more actions need to be taken, you could even fire a signaling property to fire an event in the caller.

 

Seems all quite convoluted. What is your use case in more detail?

0 Kudos
Message 3 of 5
(1,119 Views)

@altenbach wrote:

How quickly does the caller needs to know? You can occasionally (e.g. once per second) poll the state and maybe that's sufficient.

 

You probably could use the panel close event in the subVI to fire off a value change via property node referencing an LED on the main VI. If more actions need to be taken, you could even fire a signaling property to fire an event in the caller.

 

Seems all quite convoluted. What is your use case in more detail?


Dynamic Event?

 

Sure, why not fire one off to the caller in a panel close? 

 

One of the reasons why I dislike the built in prompt and dialog vis is they predate the Event Structure.  Maybe if they stay outdated for yet another quarter century we can get rid of them.


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 5
(1,111 Views)

The below image is a screen shot of a code snippet from the main program:

 

Warning Annunciation Snippet.jpg

 

 

The "Static VI Reference" on the left is linked to the attached vi. This attached vi displays a warning message.

 

The goal is to display a warning message to the user when the Event Structure's error event is triggered. If a new warning is issued, if the user has not closed the earlier warning message window, that window updates. If the user has closed the message window, a new window opens.

 

The "Close Reference", and "Open VI Reference", cover the possibility the user has closed the earlier message. I would rather these close, and open, operations be done only if the user has closed the message window, because if the window is already open, the message window disappears briefly. This brief disappearance is visually jarring to the user. I want this to run smoothly.

 

The property node's presence is an effort to detect whether the user has closed the window. But I find that neither that "Exec State", nor the "IsRunningInteractively", outputs detect this. Is there anything that can?

 

 

0 Kudos
Message 5 of 5
(1,095 Views)