Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

modeless dialogs?

Is it possible to create a modless dialog?  My purpose is to create a popup user message while continuing to process.
0 Kudos
Message 1 of 5
(3,460 Views)

If you have LabVIEW Full Development System or higher you can do this using an event structure.

Place your popup (subVI, dialog box, etc.) in an event structure inside a while loop not attached in any way to the rest of your code. Then create a user event that you can fire from elsewhere in your program that launches the dialog. Since the while loop containing the event structure is not connected to anything else in the program, it will run in parallel, allowing the program to continue processing.

Refer to the User Events section of Chapter 9 of the LabVIEW User Manual for more information on configuring a proper user event for the event structure.

If you only have the Base package, then you can do this by having a while loop not connected to the rest of the program which polls a local or global boolean variable and launches the popup when it reads a true value.

Jarrod S.
National Instruments
0 Kudos
Message 2 of 5
(3,441 Views)
Is there an example of how to do this?

I have a switch on my main front panel.  I want to press the switch and have a subVI open in a modeless dialog box.  I'd like to have data from my main program VI displayed on a chart in the subVI.

Any help is appreciated.
0 Kudos
Message 3 of 5
(3,379 Views)

Do you want this popup dialog to graph data while you still continuously acquire data? If so, you will need a way to globally share data between the top-level VI that acquires the data and the popup subVI that graphs it, while allowing the user to turn on or off the dialog through a switch.

The easiest, most robust way to do it that I can think of (and there are any number of ways of accomplishing this) would be to use Queues to send buffered data to the subVI. Queues are basicly a software buffer that can store any LabVIEW data type and allow them to be passed between subVIs on the same computer. Search the Example Finder and ni.com for some getting started tips on Queues.

I'll also attach an example below that demonstrates a very basic Acquire & Display technique using Queues and one Global Variable to trigger a stop command. The idea is that your top-level VI will acquire data in one loop and put that data in a Queue. The modeless subVI will be waiting on data from that Queue, and when it arrives it will graph it. Note that this is also an excellent technique for writing buffered data to file, analyzing it, etc.

Some things to keep in mind about this: your subVI should not be set to have Floating or Modal behavior if you still want to be able to interact with buttons on the front panel of the top-level VI. The example was written in LabVIEW 7.0.

Jarrod S.
National Instruments
Message 4 of 5
(3,353 Views)
Jarrod,

Your example was perfect!

Much thanks,
-a
0 Kudos
Message 5 of 5
(3,347 Views)