Stateflow | ![]() ![]() |
Flow Diagram Notation Example
This example shows the behavior of a Stateflow diagram that uses flow notation.
Initially the Stateflow diagram is asleep. State A.A1
is active. The condition [C_one()]
is initially true. Event E_one
occurs and awakens the Stateflow diagram. Event E_one
is processed from the root of the Stateflow diagram down through the hierarchy of the Stateflow diagram:
E_one
. There is no valid transition.
A
checks itself for valid transitions and detects a valid inner transition to a connective junction.
[C_one()]
is tested and is true; the self-loop transition is taken. Since a final transition destination has not been reached, this self-loop continues until [C_one()]
is false.
{d=my_func()}
, is executed and completed. The returned value of d
is 84.
[d<100]
is evaluated first based on the geometry of the two outgoing conditional transition segments. Because the return value of d
is 84, the condition [d<100]
is true and this transition (to the destination state A.A1
) is valid.
A.A1
exit actions (exitA1()
) execute and complete.
A
.A1
is marked inactive.
A
.A1
is marked active.
A
.A1
entry actions (entA1()
) execute and complete.
This sequence completes the execution of this Stateflow diagram associated with event E_one
.
![]() | For Loop Construct Example | Transitions from a Common Source to Multiple Destinations Example | ![]() |