Editing on Rung
Ladder elements inserted into the rung require variables to be defined for each argument.
Figure 1 - Undeclared variables in elements and blocks
WARNING: Starting with WPS version 1.30, output arguments for function blocks can be optional. These arguments will not be initialized with the declaration and can be omitted if they are not needed in the ladder logic.
To define a variable for the argument, you must enter argument edit mode. This can be done in two ways:
1) Using the mouse
Double-clicking the mouse directly on the argument.
2) Using the keyboard
Pressing the F2 key.
For elements with only one argument, pressing the F2 key directly enters argument editing mode. For elements with more than one argument, select the argument using the arrow keys and then press F2 again.
When entering editing mode, the element will appear similar to the figure below:
Figure 2 - Assigning variables
At this point, an edit box will be enabled for you to enter the variable name.
When you press the Edit button, a window to create a new variable will appear:
Figure 3 - Creating a variable if its tag is not defined
In this window, you must define the following options for the variable:
- Scope: whether it belongs to the GLOBAL or LOCAL scope
- Group: which group of the selected scope the variable belongs to
- Name: variable identification
- Size: number of elements in the array* related to the variable
- Data Type: numeric type of the variable
If there are already variables defined for the type compatible with the Ladder element, a selection box with these variables will appear along with the edit box. To select the desired variable, use the down and up arrow keys to navigate through the variables and, once the desired variable is selected, press Enter.
Figure 4 - Selecting variables while typing