LabVIEW can generate events even when no Event structure is waiting to handle them. Because the Event structure handles only one event each time it executes, place the Event structure in a While Loop that terminates when the VI is no longer interested in events to ensure that an Event structure handles all events that occur.
![]() |
Caution If no Event structure executes to handle an event and front panel locking is enabled, the user interface of the VI becomes unresponsive. If this occurs, click the Abort button to stop the VI. You can disable front panel locking by right-clicking the Event structure and removing the checkmark from the Lock front panel until the event case for this event completes checkbox in the Edit Events dialog box. You cannot turn off front panel locking for filter events. |
For example, in the following block diagram, the Event structure is outside the While Loop and front panel locking is enabled for the numeric Value Change case.
If you change the value of the numeric control, an event occurs. The Event structure executes once and handles the Value Change event. If you change the value of the numeric control again, another event occurs, and the user interface locks because front panel locking is enabled. The Event structure already executed once, and because it is not inside a While Loop, it is unable execute again to handle the second event. If you click the stop Boolean control to stop the While Loop and the VI, the VI cannot stop because the block diagram still has not handled the second event, and LabVIEW does not process the event when you click the stop Boolean control until the block diagram handles that event. You can avoid this behavior by placing the Event structure inside the While Loop.
Event structures begin waiting for events as soon as the VI runs. For example, if you configure two Event structures within the same Sequence structure to wait for a mouse click on the same front panel object, both Event structures execute as soon as the event occurs for the first time. If you want the second Event structure to execute the second time the event occurs, do not use a Sequence structure. Instead, place one Event structure inside a For Loop that you configure to execute twice.