Event Structure
- Updated2025-03-14
- 4 minute(s) read
Event Structure
Waits until an event occurs, then executes the appropriate case to handle that event. The Event structure has one or more subdiagrams, or event cases, exactly one of which executes when the structure executes to handle an event. This structure can time out while waiting for notification of an event. Wire a value to the Timeout terminal at the top left of the Event structure to specify the number of milliseconds the Event structure waits for an event. The default is -1, which indicates never to time out.
You can configure a single event case to handle multiple events , but only one of these events within the event case can occur at a time. You must place the Event structure in a While loop to handle multiple events.
A single case in the Event structure cannot handle both notify and filter events . A case can handle multiple notify events but can handle multiple filter events only if the event data items are identical for all events. You can configure any number of Event structures to respond to the same notify event or filter event on a specific object.
Before you configure events for the Event structure to handle, review the caveats and recommendations for using events in LabVIEW.

Event Structure Components
The following example shows an Event structure with the Key Down? event case.





The Event Data Node identifies the data LabVIEW returns when an event occurs. Like the Unbundle By Name function, you can resize the node vertically and select the items you need. Use the Event Data Node to access event data elements, such as Type and Time, which are common to all events. Other event data elements, like Char and VKey for example, vary based on the event you configure. You can show or hide the Event Data Node for a case when all data items are unused. Right-click the structure border and select Visible Items»Event Data Node for This Case to show or hide the Event Data Node. You cannot hide a node when it is wired or when it is inside a filter event case.

