Stateflow | ![]() ![]() |
Directed Event Broadcasting Using Qualified Event Names Example
This example shows the behavior of directed event broadcast using a qualified event name in a transition action.
Initially the Stateflow diagram is asleep. Parallel substates A
.A1
and B
.B1
are active. By definition, this implies that parallel (AND) superstates A
and B
are active. An event occurs and awakens the Stateflow diagram. The condition [data1==1]
is true. The event is processed from the root of the Stateflow diagram down through the hierarchy of the Stateflow diagram:
A
checks for any valid transitions as a result of the event. Because the condition [data1==1]
is true, there is a valid transition from state A
.A1
to state A
.A2
.
A.A1
exit actions (exitA1()
) execute and complete.
A.A1
is marked inactive.
E_one
to state B (
represented by the notation B.E_one
), is executed and completed:
E_one
awakens state B
. (This is a nested event
broadcast.) Because state B
is active, the directed broadcast is received
and state B
checks to see if there is a valid transition. There is a valid
transition from B.B1
to B.B2
.
B.B1
exit
actions (exitB1()
) execute and complete.
B.B1
is marked inactive.
B.B2
is marked active.
B.B2
entry
actions (entB2()
) execute and complete.
A.A2
is marked active.
A.A2
entry actions (entA2()
) execute and complete.
This sequence completes the execution of this Stateflow diagram associated with an event broadcast using a qualified event name to a parallel state.
![]() | Directed Event Broadcast Using send Example | Working with Charts | ![]() |