Stateflow | ![]() ![]() |
To change the properties for a data object in Stateflow, access its Event dialog as follows:
Note You can also set an event's Scope (see Defining Local Events) and Trigger properties by editing the corresponding fields in the event's entry in the Explorer's contents pane instead of opening its Event dialog. |
The Event dialog box allows you to specify event properties.
The dialog box displays the following fields and options.
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 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. An event's parent can be a Stateflow machine, a chart, or a state. You specify an event's parent when you add it to the data dictionary (see Adding Events to the Data Dictionary).
Scope
Scope of this event. The scope specifies where the event occurs relative to its parent. The following sections describe each scope setting.
Local. This event occurs in a Stateflow machine and is parented by the machine or one of its charts or states. See Defining Local Events for more information.
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 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 for more information.
Trigger
Type of signal that triggers an input or output event. See Specifying Trigger Types 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 to the Data Dictionary | Defining Local Events | ![]() |