Events in LabVIEW
- Updated2026-08-05
- 3 minute(s) read
There are three general sources that LabVIEW can monitor for events: the user interface, the block diagram, and external I/O. Additionally, you can choose how LabVIEW monitors for events and, if desired, define your own custom events.
LabVIEW generates events from the following sources.
| Event Source | Definition |
|---|---|
| User interface | Events that derive from interaction with the user interface, such as mouse
clicks, key presses, and so on. There are two general categories of user interface
events: notify events and filter events. For more information about notify and filter events, refer to Types of User Interface Events. |
| Block diagram | Programmatically generated events, including custom user events that let you generate events with data you define, and other events that occur from the block diagram. |
| External I/O | Events from external sources such as hardware timers or triggers that signal when
acquisition completes or when an error condition occurs. Note LabVIEW also supports ActiveX and .NET events, which are
external I/O events that you can generate programmatically. |
LabVIEW uses the Event structure to monitor for events and to define the code to execute when a given event occurs. Defining the events that an Event structure monitors is called event registration. There are two types of event registration in LabVIEW: static event registration and dynamic event registration. For more information, see Choosing How an Event Structure Monitors For Events.
LabVIEW provides event data about each event. The event data falls under various classes, such as Control or VI. You can use the event data that LabVIEW provides as an input to block diagram logic that you define.
You can also define your own custom events, also called user events, which you define on the block diagram. In other words, you can create user events for programmatically generated events only. User events require dynamic registration.
User Interface Events
With user interface events, you can design an application so LabVIEW generates an event each time a user performs a particular action on the front panel. Each time that the event occurs on the front panel, the block diagram responds according to the code you write for that event.
Compared to polling the user interface in a loop for interactions, user interface events provide the following advantages:
- Reduce CPU requirements for the program
- Simplify code on the block diagram
- Ensure that the block diagram can respond to all interactions the user make
LabVIEW categorizes user interface events into two different types of events: notify events and filter events.
Programmatically Generated Events
With programmatically generated events, you can generate events from the block diagram without user actions on the front panel. Programmatically generated events communicate among different parts of the program that have no dataflow dependency.
For example, consider an application with the following architecture:
- One part of the application runs a continuous loop to monitor a temperature sensor and generates a user event when the sensor reaches an alarm level.
- Another part of the same application uses an
Event structure executes to handle both of the following:
- The user event generated when the sensor reaches the alarm level.
- A user interface event that the Event structure handles to notify the user of the alarm condition.
Handling both user interface events and programmatically generated events in the same Event structure allows you to implement more advanced architectures, such as queued state machines using events.
User Interface Event Examples
For examples applying user interface events in LabVIEW, refer to the following resources:
- Event Structure.lvproj in the labview\examples\Structures\Event Structure folder
- Events.lvproj in the labview\examples\Dialog and User Interface\Events folder