Add local variables to a user-defined function block

Use
Project Organizer
or the language editor to add local variables to a user-defined function block (UDFB). Local variables are internal to the UDFB and are not exposed to the UDFB interface.
UDFBs supports a total of 128 parameters, including up to 20 input parameters or up to 20 output parameters.
In the following example, the local variables of the MY_FBD_UDFB are displayed in the variable grid, with two input variables and two output variables defined.
UDFB local variables
UDFB local variables
To add local variables to a UDFB
  1. In
    Project Organizer
    , go to
    Assets
    User-Defined Function Blocks
    <UDFB-name>
    .
  2. Expand
    <UDFB-name>
    , and then double-click
    Local Variables
    .
  3. In the local variable grid, in the empty row, enter the variable name, and then select
    Enter
    .
    • The name can contain up to 40 characters
    • The name can contain letters, numbers, or underscores.
    • The name must start with a letter.
    • The name cannot contain consecutive underscores.
    • The name must end with a letter or number.
  4. Specify other variable parameters.
    TIP: To delete a local variable, do one of the following:
    • Right-click the row header, and then select
      Delete
      .
    • Select the row, and then select the
      Delete
      key.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal