Engee documentation

Transition

Default transition (Default Transition) stateflow default transition — this is a transition that is performed before any state or node is activated. The system automatically adds a default transition for the first state and adds a node for the transition.

default transition 1

default transition 2

Transition is a line with an arrow describing the transition from one state or node of the spacecraft in which the transition begins to another. Such a transition can connect not only states, but also nodes, or connect a block of state to a node. For the transition, you can define the conditions [] and the actions {}. The transition conditions determine whether a transition to the next node or state will occur. The actions associated with the transition indicate which code on Julia will be executed during this transition.

stateflow condition 1

Syntax of transitions

Settings are set up on the transitions Temporal logic operators, indicators of changes, conditions and actions:

condition action stateflow en

Actions and conditions are subject to the following rules:

  • The conditions are specified in square brackets [].

  • Actions are specified in curly brackets {}.

  • All fields are optional and can be skipped.

  • Conditions and actions support the mathematical and logical operations of the Julia language. For example:

    stateflow example synth 1

  • You can leave comments on transitions, just like in any Julia code.:

    stateflow commentary 1 en

  • In order to accommodate multiple operators In the Julia language, use a semicolon on one line. ; as a separator:

    {y = 0; v = 1}
  • The conditions within a single transition are set using the logical operators && (and) and || (or).

    # Option with "and"
    [x>1 && x<3]
    
    # Option with "or"
    [x>1 || x<3]
  • In the conditions, operator priorities can be set in parentheses, as in the Julia language, for example:

    [x == 1 && (y == 3 || after(3,sec))] # expression (y == 3 || after(3,sec)) will be calculated first
  • Read more about the operators of temporal logic in the article Temporal logic operators;

  • Read more about the change indicators. below.

Traffic priorities

Transition priority is the order in which they are evaluated and executed if the conditions of several transitions are true at the same time.

Consider an example from articles:

im3

In the example, the Rest state has two transitions, the priorities of which are set automatically.:

sf transition prior 1

Left-click on the transition to adjust the desired priority and select Execution order:

statemachines order 1 en

You can also change the priority of the transition in the settings window by clicking on the desired transition.:

stateflow example settings 1 en

In our case, the transition to the Alarm state was set first and has the first priority, and to the Fault state is the second and second priority, respectively.

Super transitions

*Supertransition is a mechanism that allows transitions between states at any level of the hierarchy, including transitions deep into child states, transitions between parent and child states, or any transitions whose ends are on opposite sides of the boundary of a block state.

supertransition ka 1 en