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
  1. Access the
    Variable
    Selector
    .
  2. In the variables grid, locate the available definition row (with the asterisk), define the required properties, and then press
    Enter
    .
    For graphical POUs, the variable is defined for the element. For textual POUs, the variable is placed in the editor.
  3. (optional) Create multiple variables with the same prefix, suffix, data type, and continuous numbering definition:
    1. In the grid area, locate the available definition row (with the asterisk), right-click in the
      Name
      cell, and then click
      Quick
      Declaration
      .
    2. In the
      Quick
      Declaration
      dialog box, specify the numbering range, a prefix, a suffix (optional), the data type, the direction, and the string length (if applicable), and then click
      OK
      .
      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.
  4. (optional) To insert literal values, in the
    Name
    field, type the literal value, and then click
    OK
    .
    TIP: When inserting literal values beginning with a letter or an underscore, enclose the variable name in single quotes as follows: 'abc'
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal