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

Prerequisites
To add local variables to a UDFB
- InProject Organizer, go to .
- Expand<UDFB-name>, and then double-clickLocal Variables.
- In the local variable grid, in the empty row, enter the variable name, and then selectEnter.
- 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.
- Specify other variable parameters.TIP: To delete a local variable, do one of the following:
- Right-click the row header, and then selectDelete.
- Select the row, and then select theDeletekey.
Provide Feedback