DEP — DEVlink Engineering PlatformUser Guide

State Logic

State Logic is DEP's state-machine designer, for supervisors, mode managers and sequencers such as a thermal supervisor or a charging sequence. You draw states and transitions, define variables and actions, and preview transitions with events. You then prepare the machine as an executable component for the System. Open it with System → State Logic.

The Thermal supervisor example: states Idle, Active and Fault in the designer, with the Inspector showing the selected state.
The Thermal supervisor example: states Idle, Active and Fault in the designer, with the Inspector showing the selected state.

Before you start

RequirementWhat you need
EditionDEP Engineer or higher (model.state_machine.author; FMU export: fmi.export). See Licensing and Editions.
ProjectAn open project. To use the machine, a System in which you will add it as a component.
PanelContents
Project ExplorerThe project's System and existing assets, counted by type: Model, Physical, State Logic, Networks, Runtime, Test, HMI, Measurement / Calibration, Results. Counts are registered source records, not executable functionality.
State / Transition LibraryThermal supervisor example, + State, + Transition, Delete, the event buttons (for example ▶ Event: enable, ⚠ Event: fault) and the list of states.
State Machine DesignerThe diagram, with zoom and Fit.
InspectorProperties of the selected state or transition.
Runtime Trace / DiagnosticsThe trace of the preview, for example • active: Idle.

The toolbar also has Step (s) and the model bar: Saved model, Name, Save Model, Prepare for System, Export FMU and Import DEP FMU.

Steps

Try the example

  1. LoadSelect Thermal supervisor example. Three states appear: Idle (initial, ACTIVE), Active and Fault.
  2. Preview an eventSelect ▶ Event: enable. The draft follows the transition idle → active, and the trace shows the new active state.
  3. Raise a faultSelect ⚠ Event: fault to follow the fault transition.
After “Event: enable”, the machine is in Active.
After “Event: enable”, the machine is in Active.

Edit states

Select a state to edit it in the inspector (State properties):

  • Name, and Set as initial state.
  • Entry action (on entry), During action (while active) and Exit action (on exit). Actions assign variables, for example fan = 1.
  • Draft preview shows whether the state is active, and its outgoing and incoming transition counts.

Add states with + State. Duplicate with Ctrl+D. Remove with Delete.

Edit transitions

Select the source state, then + Transition. DEP adds a transition from that state to another state. Adjust the transition in the inspector's Transitions table, where each transition has:

FieldMeaning
EventThe event that triggers it, for example enable or fault.
GuardA condition that must also be true, for example temperature > 330.
ActionAssignments executed when the transition fires.
PriorityDecides between several transitions that could fire at the same time.

Remove a transition with Delete transition.

Define variables

Under Variables, select Add variable and set the name, direction (input, output or local), initial value and unit. Inputs and outputs become the ports of the component in the System. Use Remove variable to delete one.

Use the state machine in the System

  1. Type a Name and select Save Model.
  2. Select Prepare for System.
  3. In System Engineering, add the prepared model with Add component, connect its ports and run.

Export FMU exports the machine for other tools. Import DEP FMU brings back a machine exported from DEP.

Results

  • During preview, the Runtime Trace / Diagnostics panel shows the active state, for example • active: Idle, and each state's Draft preview shows whether it is active.
  • A prepared machine appears as an executable asset in System Engineering; its input and output variables are its ports.
  • In a run, the machine's outputs are recorded like any other component's (see Running MIL and SIL).

Limits

  • Event buttons preview the draft. They do not run the System. For execution, save the model and prepare it.
  • Only input and output variables become ports; local variables stay inside the machine.
  • Import DEP FMU imports machines exported from DEP.

Troubleshooting

SymptomUsually meansAction
+ Transition is disabledNo state is selected.Select the source state first.
The System does not show the latest behaviourThe machine was changed but not saved and prepared again.Select Save Model and Prepare for System, then check the component's implementation in System Engineering (Implementation & replacement).