LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Asynchronous and timed message box

Hi,

 

In a Windows and LV-64bits environment, what method do you use to display a dialog box that can be configured in asynchronous mode and with automatic closing after a certain delay?

Thank you in advance for any suggestions, and ideally, an example up to LV version 21.

 

Best regards

0 Kudos
Message 1 of 7
(200 Views)

I made a floating warning box like this.

I put an event handler in a VI and set the timeout case to whatever delay time that was needed (-1 for no timeout, etc.).  The event handler was overkill but I had some other things in mind.

I launched the VI using an asynchronous call and forget.  The launcher was wrapped in another VI to hide the details.

I use it to alert the user to non-critical errors that I do not want to interrupt execution of the calling VI.  The box pops up for a preset time, then closes automatically if not dismissed by the user.

Message 2 of 7
(182 Views)

Thank you for these indications.

 

My preference would be a native Windows “MessageBox” but I haven't found one that offers these features. If anyone knows of a method that comes close, I'm very interested.

0 Kudos
Message 3 of 7
(126 Views)

I basically use a VI that is styled to look just like a Windows Dialog box.

 

 

========================
=== Engineer Ambiguously ===
========================
Message 4 of 7
(124 Views)

@JB wrote:

Thank you for these indications.

 

My preference would be a native Windows “MessageBox” but I haven't found one that offers these features. If anyone knows of a method that comes close, I'm very interested.


Here is a possible workaround. This assumes that the message box has focus and the button you want pressed has key focus. The attached VI simulates a keyboard press, that is, the user pressing Return to dismiss the dialog. (This works if either the "Ok" or "Cancel" button has key focus. If it doesn't you can simulate a TAB press to move to the correct button.)

 

It would work as follows:

  1. Generate an occurrence.
  2. Set the Key Press VI with the occurrence, timeout, and key you want pressed.
  3. Run the dialog in parallel; if the user closes the dialog, fire the occurrence to exit the Key Press VI

snip.png

Message 5 of 7
(103 Views)

@RTSLVU  a écrit :

I basically use a VI that is styled to look just like a Windows Dialog box.

 

 


Does it autosize according to the length of the message or do you use an indicator with a vertical scrollbar ? 

0 Kudos
Message 6 of 7
(49 Views)

@JB wrote:

@RTSLVU  a écrit :

I basically use a VI that is styled to look just like a Windows Dialog box.

 

 


Does it autosize according to the length of the message or do you use an indicator with a vertical scrollbar ? 


TBH: I only use this in one place. In my qualification platform, it pops up when the user presses "Start" and gives the user one minute to select a different test step to start at or 1 (default), pressing "OK" will exit close this pop-up before the time out. That way the end user can restart a test that was aborted somewhere in the middle at the stage it was aborted. Our thermal chambers have a similar pop-up when you start a temperature profile, so I kinda used that as an example.

 

opoupCapture.PNG

 

So to answer your question, the VI is sized to match the message, but it's always the same message. 

 

BTW: It looks big because our test systems have a 19 inch touch screen, so everything I make has to have big buttons the technicians can press with their fat fingers. 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 7 of 7
(28 Views)