Download Stateflow User's Guide

Transcript
Implicit Local Events
Example: Implicit Local Event
This example uses the implicit local event entry(state_name).
Fan and Heater are parallel (AND) superstates. By default, the first time the
Stateflow diagram is awakened by an event, the states Fan.Off and
Heater.Off become active. The first time event Fan_switch occurs, the
transition from Fan.Off to Fan.On occurs. When Fan.On’s entry action
executes, an implicit local event is broadcast (ie., en(Fan.On) == 1). This event
broadcast triggers the transition from Heater.Off to Heater.On (guarded by
the condition [en(Fan.On)]. Similarly, when the system transitions from
Fan.On to Fan.Off and the implicit local event Fan.Off is broadcast, the
transition from Heater.On to Heater.Off is triggered (guarded by the condition
[en(Fan.Off)].
3-21