Stateflow    

Labeling Transitions

Transition labels contain Stateflow action language that accompanies the execution of a transition. Creating and editing transition labels is described in the following topics:

For more information on transition concepts, see Transition Label Notation.

For more information on transition label contents, see Action Language.

Editing Transition Labels

Label unlabeled transitions as follows:

  1. Select (left-click) the transition.
  1. The transition turns to its highlight color and a question mark (?) appears on the transition. The ? character is the default empty label for transitions.

  1. Left-click the ? to edit the label.
  1. An editing cursor appears. You are now free to type a label.

To apply and exit the edit, deselect the object. To reedit the label, simply left-click the label text near the character position you want to edit.

Transition Label Format

Transition labels have the following general format:

Specify, as appropriate, relevant names for event, condition, condition_action, and transition_action.

Label Field
Description
event
Event that causes the transition to be evaluated.
condition
Defines what, if anything, has to be true for the condition action and transition to take place.
condition_action
If the condition is true, the action specified executes and completes.
transition_action
This action executes after the source state for the transition is exited but before the destination state is entered.

Transitions do not have to have labels. You can specify some, all, or none of the parts of the label. Valid transition labels are defined by the following:


  Creating Straight Transitions Moving Transitions