Creating a State

Local State lets you create states in a state machine including the code. This example describes how to create a counter as state.

  1. Enter state_UpCount as Name and State_UpCount as Class Name.
  2. Activate Show Text to see the equations in the states, without opening Modelica Text editor.
  3. Click OK.
    The state is created, but with dashed outline since it must have a transition to be defined as state.

  4. In the Package Browser, double-click to open the state.
  5. Display the Modelica Editor.
  6. In the Modelica Editor, add code for the state.