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.
- 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.
- In Enum value list, select a parameter and click OK. In this guide we select mcPositiveDirection.
- The parameter has been added to the source editor. Double-click the parameter.
- In Variable property, change the parameter's name. We rename it mcPositiveDirection and click OK.
- The parameter has been renamed. Connect it to Direction.
- The parameter has been connected to Direction. If you want to change the parameter's name, double-click it again.