Virus scan in progress. Please wait to download attachments.
Events are caused by actions the user performs. For example, clicking the mouse generates a mouse event, pressing a key on the keyboard generates a keyboard event, and so on. When a system event occurs, the operating system is responsible for identifying and responding to the event. Any application running on a system can react to the system event by executing code written for that specific system event.
In LabVIEW, you can use the Event structure to handle events in an application. As with a Case structure, you can add multiple cases to the Event structure. You can then configure those cases to handle one or more events. When those events occur, LabVIEW executes the corresponding case.
Steps to Complete
Event Structures have one or more subdiagrams, or event cases, exactly one of which executes when the structure executes. The Event structure waits until an event happens, then executes the appropriate case to handle that event. Right-click the structure border to add new event cases and configure which events to handle. Wire a value to the Timeout terminal at the top left of the Event structure to specify the number of milliseconds the Event structure should wait for an event to occur. The default is –1, indicating never to time out.
The Event Data Node is attached to the inside left and right borders of each event case. The node identifies the data LabVIEW returns when an event occurs. The node displays data that is different in each case of the Event structure depending on which event(s) you configure that case to handle. If you configure a single case to handle multiple events, only the data that is common to all handled event types is available.