| Using Stateflow | Search  Help Desk |
Semantic Rules Summary
Entering a Chart
The set of default flow paths is executed (see "Executing a Set of Flow Graphs"). If this does not cause a state entry and the chart has parallel decomposition, then each parallel state is entered (see "Entering a State").Executing an Active Chart
If the chart has no states, each execution is equivalent to initializing a chart. Otherwise, the active children are executed. Parallel states are executed in the same order that they are entered.Entering a State
.If the parent of the state is not active, perform steps 1-4 for the parent.
.If this is a parallel state check that all siblings with a higher entry order are
active. If not perform all entry steps for these states first.
....If this is a parallel state, perform all entry actions for the sibling state next
in entry order if one exists.
.Executing an Active State
...Exiting an Active State
..If there are any active children perform the exit steps on these states in the
reverse order they were entered.
..Mark the state as inactive.
Executing a Set of Flow Graphs
Flow graphs are executed by starting step 1 below with a set of starting transitions. The starting transitions for inner flow graphs are all transition segments that originate on the respective state and are directed inwards at their source. The starting transitions for outer flow graphs are all transition segments that originate on the respective state and are directed outwards at their source. The starting transitions for default flow graphs are all default transition segments that have starting points with the same parent:.. No more transition segments are tested and a transition path is formed
by backing up and including the transition segment from each preceding
junction until the respective starting transition.
The transition actions from the entire transition path are executed in the
order they the respective segments were validated.
.After testing all outgoing transition segments at a junction, back up the
incoming transition segment which brought you to the junction and continue
at step 2, starting with the next transition segment after the back up
segment. The set of flow graphs is done executing when all starting
transitions have been tested.
Executing an Event Broadcast
Output edge trigger event execution is equivalent to changing the value of an output data value. All other events have the following execution:.send() function.)
.