Added input and output
Now we'll see how to create inputs and outputs for the USERFB block.
- In the Projects window, double-click the USERFB file to open the block's Ladder editor.
- In the Window menu, click Variables.
Analyzing the figure below, we see that the USERFB Variables window is different from other Ladder files. It only contains volatile and retentive variables of LOCAL scope, which are the internal variables of the block used in the subroutine. In addition to these, it has three other categories: VAR_IN, VAR_OUT, and VAR_IN_OUT.
-
VAR_IN: Internal variables that will be the input arguments of this block.
-
VAR_OUT: Internal variables that will be the output arguments of this block.
-
VAR_IN_OUT: Internal variables that will be the input and output arguments for this block.
- To create an input, click the VAR_IN tab and click the + symbol. In the window that appears, assign a name and type to this variable and click OK.
- To create an output, click the VAR_OUT tab and click the + symbol. In the window that appears, assign a name and type to this variable and click OK.
- To create an input and output argument, click the VAR_IN_OUT tab and click the + symbol. In the window that appears, assign a name and type to this variable and click OK.