Skip to content

Command

class Command

A Command is a control command on a ControllerInterface - one operational mode that can be requested of the controller, such as on, off or a motion step. A parent issues a child's command from its statemachine code, and the child reacts to it in its own transitions.

Create a Command:

  • Select the package where the command should be hold
  • Open resource assist l4ccn0y4
  • A Command is created by selecting the command element

h2qh2h0o

  • In the Wizard, the command name must be set

The command constant is given automatically. It can be changed if necessary.
l9wttxq2


NOTE: Best practice

Standard commands for all controllers

If it is necessary to assign the same commands to several controllers, it is recommended to define a separate controller interface which contains these shared commands.

This interface can then be integrated (implemented) in the individual controller interfaces.

state = command

In many cases it makes sense that the final state has the same name as the underlying command. This makes it easier to evaluate whether a child controller has reached the desired state. The command can be directly compared with the state of the child controller.

Example:

Parent → Child, Command = EOFF

Child → Parent, State = EOFF

UP implicitly supports this approach. As soon as a command has the same name as a state, both are given the same constant value. In this way, the state of a child controller can be compared directly with the set command.