Define Events

How to Add Events Using the Stateflow Editor

  1. Based on the desired scope for the new event, select one of the following options:

    ScopeMenu Option
    InputChart > Add Inputs & Outputs > Event Input From Simulink
    OutputChart > Add Inputs & Outputs > Event Output To Simulink
    LocalChart > Add Other Elements > Local Event

    The Event properties dialog box appears after you select one of those options.

  2. Specify properties for the new event in the Event properties dialog box, as described in Set Properties for an Event.

How to Add Events Using the Model Explorer

  1. In the Stateflow® Editor, select View > Model Explorer.

    The Model Explorer appears.

  2. In the Model Hierarchy pane, 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. In the Model Explorer, 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 Set 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.

Was this topic helpful?