Stateflow    

Adding Events to the Data Dictionary

You can use either the Stateflow diagram editor or Explorer to add up to 254 events. If you add events in the Stateflow diagram editor, they are visible to all objects in the chart. You must use the Stateflow Explorer to add events that are visible only within the state, chart, or Stateflow machine that you add them to.

Using the Stateflow Editor

To use the Stateflow editor to add an event, do the following:

  1. From the Add menu of the Stateflow editor, select Event.
  2. In the resulting submenu, select the event's scope (see Scope for an explanation).
  1. Stateflow adds a default definition of the new event to the Stateflow data dictionary and displays the Event dialog box.

  1. Use the Event dialog box to specify event options (see Setting Event Properties).

Using the Explorer to Define Events

To use the Stateflow Explorer to define an event:

  1. Select Explore from the Stateflow editor's Tools menu.
  1. Stateflow opens the Explorer.

  1. Select the object (machine, chart, or state) in the Explorer's object hierarchy pane where you want the new event to be visible.

  2. Select Event from the Explorer's Add menu.
  1. Stateflow adds a default definition for the new event in the data dictionary and displays an entry for the new event in the Explorer's content pane.

  1. Set the new event's properties to values that reflect its intended usage (see Setting Event Properties).

  Defining Events Setting Event Properties