| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Stateflow |
| Contents | Index |
| Learn more about Stateflow |
| On this page… |
|---|
An event is a Stateflow object that can trigger actions in one of these objects:
A Simulink triggered subsystem
A Simulink function-call subsystem
A Stateflow chart
Use events when you want to do one of the following:
Activate a Simulink triggered subsystem (see Using Edge Triggers to Activate a Simulink Block)
Activate a Simulink function-call subsystem (see Using Function Calls to Activate a Simulink Block)
Trigger actions in parallel states of a Stateflow chart (see Broadcasting Events in Actions)
Although Stateflow software does not limit the number of events you can use in a chart, the underlying C compiler enforces a theoretical limit of (2^31)-1 events for the generated code.
An explicit event is an event that you define and can have one of the following scopes.
| Scope | Description |
|---|---|
| Local | Event that can occur anywhere in a Stateflow machine but is visible only in the parent object (and descendants of the parent). See Directed Event Broadcasting. |
| Input from Simulink | Event that occurs in a Simulink block but is broadcast to a Stateflow chart. See Using Input Events to Activate a Stateflow Chart. |
| Output to Simulink | Event that occurs in a Stateflow chart but is broadcast to a Simulink block. See Using Output Events to Activate a Simulink Block. |
An implicit event is a built-in event that broadcasts automatically during chart execution (see Using Implicit Events).
You can define explicit events at these levels of the Stateflow hierarchy.
| An event you define in a... | Is visible to... |
|---|---|
| Chart | The chart and all states and substates |
| Subchart | The subchart and all states and substates |
| State | The state and all substates |
![]() | Defining Events | How to Define Events | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |