Creating Variables from the Variable Selector
When creating variables from the
Variable
Selector
, define the variables in the variables grid to specify values for all variable
properties. In the grid, create a variable by providing the required information in the cells
of the available definition row (with an asterisk). Quick
Declaration
enables creating multiple variables with the same prefix, suffix
(optional), numbering range, data type, direction, and string length (string or message data
types only).
IMPORTANT:
The preferred method to create variables is from
dictionary instances to avoid potential mistakes like inserting a variable in an unintended
scope.
To create a variable from the Variable Selector
- Access theVariableSelector.
- In the variables grid, locate the available definition row (with the asterisk), define the required properties, and then pressEnter.For graphical POUs, the variable is defined for the element. For textual POUs, the variable is placed in the editor.
- (optional) Create multiple variables with the same prefix, suffix, data type, and continuous numbering definition:
- In the grid area, locate the available definition row (with the asterisk), right-click in theNamecell, and then clickQuickDeclaration.
- In theQuickDeclarationdialog box, specify the numbering range, a prefix, a suffix (optional), the data type, the direction, and the string length (if applicable), and then clickOK.The numbering range indicates the number of variables to create. For example, a range of 0 to 9 creates ten variables. When using the quick declaration method for creating variables, the consecutive variables shall have the same prefix followed by the starting range number, and optionally finishing with the same suffix.
- (optional) To insert literal values, in theNamefield, type the literal value, and then clickOK.TIP: When inserting literal values beginning with a letter or an underscore, enclose the variable name in single quotes as follows: 'abc'
Provide Feedback