
A custom dialog is one of the most repeated pieces of code in a LabVIEW application: a settings window, a confirmation, a prompt for a serial number before a test starts. LabVIEW’s built-in One Button and Two Button Dialog functions cover simple messages. Once a dialog needs its own controls, defaults or validation, you need a VI of your own. This snippet is the framework ITM’s developers start from, and it gets a new dialog running in under a minute:
- Create a new VI.
- Drag the snippet at the top of this post (Figure 1) onto the block diagram. LabVIEW turns the image into code. The snippet was saved in LabVIEW 2020, so it opens in 2020 or later.
- Open File » VI Properties » Window Appearance and select Dialog (Figure 2).
- Optional: clear Same as VI name and enter a custom window title.
- Save and run the VI.

How the framework works
The block diagram is a while loop around an event structure, so the dialog sits idle until the operator does something.
- Settings in, settings out. The settings cluster rides in a shift register. Whatever the operator changes is carried round the loop and returned when the dialog closes. Replace the cluster with the data your dialog edits.
- One event case per button. The snippet shows the OK: Value Change case: it sets Stop to True to end the loop and Cancelled? to False. Give Cancel its own case that returns True, so the calling VI knows to discard the settings.
- Errors pass straight through. error in and error out run along the bottom of the loop, so a dialog called after an upstream failure passes that error on instead of hiding it.
What the Dialog setting changes
Choosing Dialog is a shortcut for a group of window settings. The front panel opens when the VI is called as a subVI and closes when it finishes. The window is modal, so it stays in front of the application until the operator responds. The menu bar and toolbar are hidden. Click Customize… to see or change each one. Two more settings worth making:
- Map Enter to OK and Esc to Cancel on each button’s Properties » Key Navigation tab.
- Set VI Properties » Window Run-Time Position to Centered, so the dialog opens in the middle of the screen.
The error case structure
Inside the OK case is another snippet we use everywhere (Figure 3). Wire error in to a case structure’s selector and it gets No Error and Error cases. Put your code in No Error; the Error case passes the incoming error straight through, so nothing runs on bad data.

What’s next?
More from the LabVIEW Channel: sorting cluster arrays, subpanels and splitter bars.
Building your own LabVIEW dialogs and snippets? Talk to the engineers behind ITM’s LabVIEW development work.
Related solutions
Software
iTestSystem and the LabVIEW-based software platform behind ITM’s data acquisition tools. Explore →
Data Acquisition
DAQ hardware built to work hand-in-hand with the LabVIEW software driving it. Explore →
Consulting
Engineering consulting for custom LabVIEW development and test software architecture. Explore →
Recent insights
-
Aerospace Engineering, Aerospace Testing, Blue Origin, Engineering, ESCAPADE Mission, Launch Vehicle Engineering, New Glenn, Rocket Reliability, Strain Measurement, structural health monitoring, Structural TestingHow Pre-Launch Structural Testing Ensures Mission Success
When Blue Origin’s New Glenn rocket successfully launched NASA’s ESCAPADE mission to Mars, it marked a historic step forward for commercial launch technology — and a testament to the unseen engineering that happens long before a vehicle ever reaches…
-
6D Testing & Analysis, Accelerometers, data acquisition systems, design validation, Engineering, engineering measurement, experimental modal analysis, impact hammer testing, mechanical engineering, modal testing, structural dynamics, Structural Testing, vibration testingFree Engineering Guide: How to Perform Experimental Modal Analysis for Better Structural Insight
Understanding how structures vibrate—and why—is essential across nearly every engineering discipline. Whether you’re working on rotating machinery, industrial equipment, robotics, medical devices, heavy vehicles, consumer products, or building-scale…
-
AWS IoT Analytics, cDAQ-9189, Channel Synchronization, CompactDAQ, Condition-Based Maintenance, Edge-to-Cloud High-Channel Datalogging, Engineering, Instrumentation, iTestSystem, iTestSystem Automated Analytics, iTestSystem Notification Service, NI-9236, NI-9469, Strain, Stress, structural health monitoringHigh Channel Count Synchronous Datalogging
When a manufacturer needed to validate the structural performance of a 38-ton on-highway vehicle, ITM deployed a 200+ channel synchronous datalogging system capable of capturing accelerometer, strain, GPS, and speed data at nearly 2 kS/s per channel…
