Stateflow | ![]() ![]() |
Exporting Events
Stateflow allows a Stateflow machine to export events. Exporting events enables external code to trigger events in the Stateflow machine. To export an event, first add the event to the data dictionary as a child of the Stateflow machine (see Adding Events to the Data Dictionary). Then set the new event's Scope
property to Exported
.
The Stateflow code generator generates a function for each exported event. The C prototype for the exported event function has the form
where EVENT
is the name of the exported event. External code built into a target can trigger the event by invoking the event function. For example, suppose you define an exported event named switch_on
. External code can trigger this event by invoking the generated function external_broadcast_trigger_on
. See Exported Events for an example of how to trigger an exported event.
![]() | Defining Local Events | Importing Events | ![]() |