Skip to Main Content Skip to Search
Product Documentation

How to Define Events

Adding Events Using the Stateflow Editor

In the Stateflow Editor, you can add events to your Stateflow chart. Follow these steps:

  1. In the Stateflow Editor, select Add > Event.

  2. In the resulting submenu, select the scope for the event.

    The Stateflow Editor adds a default definition of the new event to the Stateflow hierarchy, and the Event properties dialog box appears.

  3. Specify properties for the event in the Event properties dialog box, as described in Setting Properties for an Event.

Adding Events Using the Model Explorer

To add events using the Model Explorer:

  1. In the Stateflow Editor, select Tools > Explore.

    The Model Explorer appears.

  2. In the Model Explorer, select the object in the Stateflow hierarchy where you want the new event to be visible.

    The object you select becomes the parent of the event.

  3. Select Add > Event.

    The Model Explorer adds a default definition for the new event in the hierarchy and displays an entry row for the new event in the Contents pane.

  4. Change the properties of the event you add in one of these ways:

    • Right-click the event row and select Properties to open the Event properties dialog box.

      See Setting Properties for an Event for a description of each property for an event.

    • Click individual cells in the entry row to set specific properties such as Name, Scope, and Port.

  


Free Stateflow Interactive Kit

Learn how engineers use Stateflow to model state machines in their Simulink models.


Get free kit

Trials Available

Try the latest version of Stateflow.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS