Programmatically generated events are events that occur as a result of the execution of diagram code.
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.