Stateflow    

Setting Event Properties

To change the properties for a data object in Stateflow, access its Event dialog as follows:

  1. Select Explore from the Stateflow editor's Tools menu.
  2. In the resulting Stateflow Explorer window, expand sections of the hierarchy to find the event whose properties you want to change.
  3. Right-click the event in the Explorer's hierarchy pane (left pane).
  4. Select Properties from the resulting context menu.
  1. In place of steps 3 and 4 you could also simply select the event and then select Properties from the Edit menu.

  1. In the resulting Event dialog, set the item's properties.
  2. Select OK to apply your changes and dismiss the 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