From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
mkdieric

User Dialog that doesn't keep the rest of my code waiting until OK is pressed

Status: Declined
Functionality already in LabVIEW

I'd like to have a user dialog that shows a message to the user but doesn't wait for the OK button being pressed to continue. I want to use it as a simple informative pop-up window that the user can close whenever he or she read it, without my code having to wait for the OK button.

I now use a self made VI that I call using the VI Server method 'Run VI' with 'Wait until done' set to FALSE. Or did I miss something obvious?

 

Manu

Certified LabVIEW Developer (CLD)
6 Comments
Knight of NI

The only way to display a dialog box like that (or any other VI for that matter) is to spin it off using the VI Server as you are currently doing. That said, if you were to extend this logically, then what's really being asked here is the ability to launch a VI dynamically without having to use the VI Server. To be honest, I'm not sure what I think about that, but I would lean to be against this idea.

 

Rather, I would suggest that rather than making the VI specific to that dialog, you make a VI that is generic in that it wraps the Open VI Reference, Run Method, and Close Reference. You would just need to pass in the path to the VI. 

BrianKincaid
Member

We do this using Queues.  You have a producer that adds messages to the queue (your dialog box message) and there is another section of code that is kicked off at the beginning of your execution that is the message consumer.  The consumer simply pops up a window with any messages in the queue.  This way it does not stop execution of the producer code.

 

There is some more information and examples on queues available with help.

 

Brian

mkdieric
Member

Thanks for the feedback.

@smercurio_fc : I did exactly what you describe,but I even wrapped the pat. I only send in the message to display.

@ BrianKincaid : though it is a valid solution, I was looking for something simpler then a producer/consumer scheme.

Certified LabVIEW Developer (CLD)
altenbach
Knight of NI

You can just make a dialog VI that completes immediately (i.e. no while loop, etc.) and set the window to not close when done. Now just call the VI and close it's window at leisure later with the X in the upper right corner. 

 

mkdieric
Member

Thanks for that (I had a feeling I missed something obvious)!

 

Certified LabVIEW Developer (CLD)
G-Money
NI Employee (retired)
Status changed to: Declined
Functionality already in LabVIEW