Table Of Contents

Programmatically Generated Events

Last Modified: February 27, 2020

Programmatically generated events are events that occur as a result of the execution of diagram code.

A user event is a type of programmatically generated event. Unlike user interface events, which require direct user interaction with front panel objects, user events allow you to create an application that responds to programmatic changes on objects. In order for an Event Structure to process a user event, you need to complete the following steps:
  1. Create the event using the Create User Event node.
  2. Register for the event using the Register for Events node.
  3. Enable the dynamic event terminals on the Event Structure.

Programmatically generated events communicate among different parts of the program that have no dataflow dependency. For example, one part of an application may run a continuous loop to monitor a temperature sensor and generate a user event when the sensor reaches an alarm level. In a different part of the same application, an Event Structure executes to handle both the user event generated when the sensor reaches the alarm level and 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.

Recently Viewed Topics