Stateflow    

Label Format for Transition Segments Example

The general label format for a transition segment entering a junction is the same as for transitions entering states, as shown in the following example:

Execution of a transition in this example occurs as follows:

  1. When an event occurs, state S1 is checked for an outgoing transition with a matching event specified.
  2. If a transition with a matching event is found, the transition condition for that transition (in brackets) is evaluated.
  3. If condition_1 evaluates to true, the condition action condition_action (in braces) is executed.
  4. The outgoing transitions from the junction are checked for a valid transition. Since condition_2 is true, a valid state-to-state transition (S1 to S2) is found.
  5. State S1 is exited (this includes the execution of S1's exit action).
  6. The transition action transition_action is executed.
  7. The completed state-to-state transition (S1 to S2) is taken.
  8. State S2 is entered (this includes the execution of S2's entry action).

  Connective Junction Examples If-Then-Else Decision Construct Example