Events in LabVIEW let your programs monitor for when certain actions take place. Events let you handle these actions with custom code that executes for the action you specify.

In LabVIEW, data flow determines when block diagram elements execute. A node executes after receiving all required inputs, and then the node generates data to pass to the next node in the dataflow path.

Event-driven programming allows you to influence how a program executes with an event—an input that provides an asynchronous notification that something occurred.

For example, if you want an event to occur when the user presses a specific key on the front panel, you can design a LabVIEW application to do the following:

  1. Include a loop that waits until the key press event occurs.
  2. Handle that event with code you define to execute when the event occurs.
  3. Return to wait for the next event.

While the loop waits for the event to occur, other parts of the application can continue to run. How the application handles each event depends on the code that you write for that specific event. Some sections of the program may execute frequently because the events those sections handle occur frequently, and other sections of the program may not execute at all because the events never occur.

Frequently Asked Questions