Add Another Instance of a Direct Variable to a Ladder Diagram
You can use the Variables list to add multiple instances of the same direct variable to a Ladder Diagram. You can add the first instance of the direct variable by dragging the corresponding database item from the Database Bar onto the Ladder diagram and then configuring the variable settings. For subsequent instances of the direct variable, you can use the Add option that is available from the Direct tab of the Variables list:
To add another instance of a direct variable:
- In the Variables list (above the Ladder Diagram in the ladder display), select the Direct tab.
A list of the Ladder Diagram's direct variables is shown. - Click anywhere on the Variables pane.
A context sensitive menu is displayed. - Select the Add option.
The Add Direct Variable window is displayed.NOTE: As an alternative to steps 1-3 inclusive, you can drag and drop the same item onto the Ladder Diagram twice. When you add a direct variable, the Add Direct Variable window is displayed. You will need to rename the second instance of the item by using the Add Direct Variable window's Name field.
- Use the Add Direct Variable window to define the new instance of the variable:
- Enter a Name for the direct variable. The name has to be unique. It cannot have the same name as any variables that are already included in the Ladder diagram.
- Use the Tag Type combo box to define whether the variable is Read Only, Write Only, or Read/Write.
- Use the browse button feature of the Tag field to select the database property that is the source of the variable's value. The tag can be an OPC tag (for normal, direct variable values) or an OPC Historic tag (see Add Processed Historic Values to Ladder Diagrams).
ATTENTION: If a database item's name includes parentheses ( ), you should ensure that each opening parenthesis is paired with a closing parenthesis. If this is not the case, any Logic programs that reference the database item will not compile successfully. For example, a point named "Analog Point (4" or "Analog Point (4))" will generate a compile error message. Multiple sets of parentheses will compile successfully, including nested parentheses. For example, a Logic program can refer to a point named "Analog Point (4)" or "Analog Point (4(x))". For more information, see Limitation for Database Item Names Referenced in Logic Programs in the ClearSCADA Guide to Logic.
- Use the Type combo box to choose the type of value. The value type needs to be appropriate to the value that is represented by the selected tag. For more information, please refer to Built-In Data Types.
- The Retained feature is designed to be used with internal variables. When selected, it allows the internal variable to be stored and transferred to other servers (in a multi-server setup).
For more information on the Retain feature, see Using the RETAIN Keyword in an ST Program.
- Use the No Cache check box to determine whether the program uses the latest value or the initial value for a variable on each execution. If you check the No Cache check box, the program will use the latest value for the variable rather than the default value. If you clear the No Cache check box, the program will use the default value for the variable on each execution.
The No Cache feature is especially useful with variables that are used as counts. For more information on the No Cache feature, please refer to Using VAR NOCACHE to Prevent Cached Values Being Used in an ST Program.
- Select the OK button to confirm your selection.
The Add Direct Variable window is closed. - Select the new variable in the Variables list and keep the left-hand mouse button pressed down.
- Drag the new variable from the Variables list onto the Ladder diagram.
A context sensitive menu is displayed. - Select the option that corresponds with the type of variable that you are adding to the Ladder diagram (see Ladder Diagram Components).
A new contact or coil is added to the Ladder diagram, depending on the option you selected. The contact or coil represents the new instance of the variable.