Add a parameter

In a function block, some parameters' values can be selected from a specific list. You can drag it to the source editor without manually creating a variable to control it.

  1. In the MC_MoveAbsolute function block (FB), we want to add a value for the Direction parameter, whose values are stored in the MC_Direction enum. To select a value, In Library Tree, in the Enumerations folder, find MC_Direction and drag it to the source editor.
  2. In Enum value list, select a parameter and click OK. In this guide we select mcPositiveDirection.
  3. The parameter has been added to the source editor. Double-click the parameter.
  4. In Variable property, change the parameter's name. We rename it mcPositiveDirection and click OK.
  5. The parameter has been renamed. Connect it to Direction.
  6. The parameter has been connected to Direction. If you want to change the parameter's name, double-click it again.