A Stateflow chart can include data, event, and message type symbols. Events can be created using the Symbols pane or the Model Explorer, and they can have three different scopes, each with typical uses:
- Local: Used to control local functions and transitions within the chart.
- Input from Simulink: Used to control the execution of the chart based on an external event.
- Output to Simulink: Used to control other charts or blocks outside the chart.
The second and third scope types are demonstrated in the attached Simulink file, event_R2016b.slx. In this model, the execution of the Loop Scheduler chart is managed by an external event named call.
Additionally, the Loop Scheduler outputs an event A1 that controls the function call subsystem System A1.
For further reading about Stateflow Events, kindly execute the following command in the MATLAB Command Window:
web(fullfile(docroot, 'stateflow/events.html'))