Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Example Program
NI Supported: Yes
Publish Date: Sep 6, 2006


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Non-Blocking Dialog Box Using Queues

1 ratings | 4.00 out of 5
Print

Downloads

Filename: nonblockingdialogbox.vi
Requirements: View

When using the One Button Dialog VI, any code downstream of the One Button Dialog VI will not be executed until the user presses the "OK" button. This is considered a "blocking" dialog box. A non-blocking dialog box is a dialog box that does not stop the execution of the rest of the code while waiting on the user to press the "OK" button. There are several ways to create non-blocking dialog boxes.

The most efficient and robust way to create a non-blocking dialog box is to utilize a queued producer/consumer architecture. In the producer loop, a dialog message is enqueued. In the consumer loop, the dialog message is dequeued and sent to the One Button Dialog VI. This enables the code in the producer loop to continue executing while the consumer loop is paused, waiting for the user to press the OK button.

This VI shows how to create a Non-Blocking Dialog Box with
a producer/consumer architecture using queues.

Directions:
1) Run the VI and watch the current time elapse
2) Select Blocking and press Display Dialog Box.
- Notice how the current time stops updating. Click OK.
3) Select Non-Blocking and press Display Dialog Box.
- Notice how the current time continues to elapse.
4) Press Stop to stop the VI.


Related Links:
KnowledgeBase DIRECT-3S8RDE: What Is a Queue?
Developer Zone Tutorial: Application Design Patterns: Producer/Consumer

Requirements


Filename: nonblockingdialogbox.vi

Software Requirements


Application Software: LabVIEW Full Development System 7.0
Language(s): LabVIEW

 
1 ratings | 4.00 out of 5
Print

Reader Comments | Submit a comment »

 

Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).