12-28-2022 10:13 PM
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?
12-29-2022 02:13 AM - edited 12-29-2022 02:15 AM
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.
12-29-2022 12:18 PM - edited 12-29-2022 12:18 PM
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?
12-29-2022 01:20 PM
@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.
12-29-2022 08:47 PM
The below image is a screen shot of a code snippet from the main program:
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?