Stateflow User's Guide Previous page   Next Page

Adding Events

An event is a Stateflow object that triggers actions in a Stateflow machine or its environment. Stateflow defines a set of events that typically occur whenever a Stateflow machine executes (see Defining Implicit Events). You can define other types of events that occur only during execution of a specific Stateflow machine or its environment through the Scope property for an event, which can have one of the following values:

Events that you add to a parent object are visible to all of its children. Events that you add to the Stateflow machine are visible to all Stateflow diagrams in the model and all of their states and substates. Events that you add to the Stateflow diagram are visible to the diagram and all of its states and substates. Events that you add to a state is visible to the state and all of its substates.

You can add events in the Stateflow diagram editor and in the Model Explorer. In the Model Explorer you can add events to all levels of Stateflow hierarchy including the Stateflow machine, the Stateflow diagram (chart), and individual states in the Stateflow diagram. In the Stateflow diagram editor, you can add events only to the Stateflow diagram.

See one of the following topics to learn how to add events from the Stateflow diagram editor or Model Explorer:


Previous page  Defining Events and Data Adding Events in the Stateflow Diagram Editor Next page

© 1994-2005 The MathWorks, Inc.