Stateflow |
 |
Adding Input Events from Simulink
The following steps describe how to add an input event to a chart in Stateflow Explorer:
- Add an event to the chart using the Stateflow diagram editor or Stateflow Explorer (see Adding Events to the Data Dictionary).
- You must add the event to the chart and not to any other object in the chart. Adding events with the Stateflow diagram editor adds them only to the chart that is visible in the diagram editor. In Stateflow Explorer, you must select (highlight) the chart object in the hierarchy shown in the left pane of the Explorer before adding the event.
- Set the event's Scope to Input from Simulink.
- A single Simulink trigger port is added to the top of the Stateflow block.
- Change the event's Trigger for the input event from the resulting pop-up menu.
- The type of Trigger indicates what kind of signal in Simulink triggers the input event to the chart. It can have one of the following values:
Trigger
|
Description
|
Rising
|
Rising edge trigger, where the control signal changes from either 0 or a negative value to a positive value.
|
Falling
|
Falling edge trigger, where the control signal changes from either 0 or a positive value to a negative value.
|
Either
|
Either rising or falling edge trigger.
|
Function Call
|
Function call triggered.
|
See Specifying Trigger Types for more information.
If you choose to add an event in the Stateflow Explorer, you can also change its Name, Scope, and Trigger properties directly in the Explorer (see Setting Properties for Data, Events, and Targets).
| Adding Input or Output Data and Events to Charts | | Adding Output Events to Simulink |  |