State Machine Blocks

State machine blocks are usually associated to blocks to represent the behavior of a system or a sub-system as it transitions from one state to another.

Context

With a state machine block, you can create state machine diagrams (see State Machine Diagrams) as its sub-diagrams. If the state machine block is associated to a block (see Blocks), then its sub-diagram can reference all of the block’s operations and receptions, as well as all the activity blocks in the model.

Procedure

  1. Drag the State Machine Block tool from the toolbox and drop it on the diagram. Specify a name for it as appropriate.

    The following properties are available on the Info tab in the General category:

    Property

    Description

    Name/Code/Comment

    Identify the object. The name should clearly convey the object's purpose to non-technical users, while the code, which is used for generating code or scripts, may be abbreviated, and should not normally include spaces. You can optionally add a comment to provide more detailed information about the object. By default the code is synchronized with the name. To decouple name-code synchronization, enter a new code in the Code field.

    The other tabs such as Dependencies and Diagrams contain additional properties information. For details, see Object Properties.
  2. Select the Links tool from the toolbox and draw a Composition link between the state machine block and a block as appropriate.
  3. [optional] Use the Create State Machine Diagram tool to create a state machine diagram as the sub-diagram of the state machine block, which is listed in its property sheet Diagrams tab All Diagrams category.

    The new diagram opens in a new tab. The diagram is initialized with a frame, which represents the boundary of the state machine block. The relevant properties of the state machine block are also displayed on the diagram frame.

  4. [optional] To view a sub-diagram owned by the state machine block, click the + icon on the block's symbol to open a list of all its sub-diagrams, then select a sub-diagram as appropriate.
    The new diagram opens in a new tab.