.Modelica_StateGraph2.Step

Information

A Step is the graphical representation of a state and is said to be either active or not active. A StateGraph2 model is comprised of one or more steps that may or may not change their states during execution. The input port of a Step (inPort) can only be connected to the output port of a Transition, and the output port of a Step (outPort) can only be connected to the input of a Transition. An arbitrary number of input and/or output Transitions can be connected to these ports.

The state of a step is available via the output variable active that can be used in action blocks (e.g. "step.active"). Alternatively, via parameter "use_activePort" the Boolean output port "activePort" can be enabled. When the step is active, activePort = true, otherwise it is false. This port can be connected to Boolean action blocks, e.g., from Modelica_StateGraph2.Blocks.MathBoolean.

Every StateGraph2 graph must have exactly one initial step. An initial step is defined by setting parameter initialStep at one Step or one Parallel component to true. The initial step is visualized by a small arrow pointing to this step.

In the following table different configurations of a Step are shown:

Parameter setting Icon Description
Default step If the step is active, the public Step variable "active" is true otherwise, it is false. An active Step is visualized by a green fill color in diagram animation.
use_activePort = true If the step is active, the connector "activePort" is true otherwise, it is false (the activePort is the small, violet, triangle at the rigth side of the Step icon). Actions may be triggered, e.g., by connecting block MultiSwitch to the activePort.
initialStep = true Exactly one Step or Parallel component in a StateGraph2 graph must have "initialStep = true". At the first model evaluation during initialization, "active" is set to true for the initial Step or the initial Parallel component, i.e., the respective component is activated.

The inPort and the outPort connectors of a Step are "vectors of connectors". How connections to these ports are automatically handled in a convenient way is sketched here in the tutorial.


Generated at 2024-12-21T19:25:56Z by OpenModelicaOpenModelica 1.24.3 using GenerateDoc.mos