| Stateflow User's Guide | ![]() |
Setting Event Properties in the Event Dialog
You set all properties for an event through its Event dialog. You access the Event dialog for an event in one of the following ways:
See Adding Events in the Stateflow Diagram Editor for a description of how to add an event in the Stateflow diagram editor.
See Adding Events in the Model Explorer for a description of how to open the Model Explorer and add an event.
The Event dialog for an event has the following appearance:
Name
Name of this event. Event names enable actions to reference specific events. You assign a name to an event by setting its Name property. You can assign any name that begins with an alphabetic character, does not include spaces, and is not shared by sibling events.
Parent
Clicking this read-only field displays the parent of this event in the Stateflow editor. The parent is the object in which this event is visible. When an event is triggered, Stateflow broadcasts the event to the parent and all the parent's descendants. The parent for an event can be a Stateflow machine, a chart, or a state. You specify the parent for an event when you add it to the data dictionary (see Adding Events).
Scope
Scope of this event. The scope specifies where the event occurs relative to its parent. The following sections describe each scope setting.
Local. A local event is an event that can occur anywhere in a Stateflow machine but is visible only in its parent (and its parent's descendants).
Input from Simulink. This event occurs in one Simulink block and is broadcast in another. The first block can be any type of Simulink block. The second block must be a Chart block. See Defining Input Events for more information.
Output to Simulink. This event occurs in one Simulink block and is broadcast in another. The first block is a Chart block. The second block can be any type of Simulink block. See Defining Output Events for more information.
Exported. An exported event is a Stateflow event that can be broadcast by external code built into a stand-alone or Real-Time Workshop target. See Exporting Events to Stateflow External Code for more information.
Imported. An imported event is an externally defined event that can be broadcast by a Stateflow machine embedded in the external code. See Importing Events from Stateflow External Code for more information.
Trigger
Type of signal that triggers an input or output event. See Defining Input Events or Defining Output Events for more information.
Index
Index of the input signal that triggers this event. This option applies only to input events and appears when you select Input from Simulink as the scope of this event. See Associating Input Events with Control Signals for more information.
Port
Index of the port that outputs this event. This property applies only to output events and appears when you select Output to Simulink as the scope of this event. See Associating an Output Event with an Output Port for more information.
Description
Description of this event. Stateflow allows you to store brief descriptions of events in the data dictionary. To describe a particular event, enter its description in this field.
Document Link
Stateflow allows you to provide online documentation for events defined by a model. To document a particular event, set its Documentation property to a MATLAB expression that displays documentation in some suitable online format (for example, an HTML file or text in the MATLAB command window). Stateflow evaluates the expression when you click the event's documentation link (the blue text that reads "Document Link" displayed at the bottom of the event's Event dialog box).
| Adding Events in the Model Explorer | Sharing Events with Simulink | ![]() |
© 1994-2005 The MathWorks, Inc.