Replacing already inserted variables

How to replace an already inserted →variable in the Values of Variables view:

  1. If the variable is included within a collapsed level, expand this collapsed level.
    To speed the expanding up: Filter the view. The levels with found matches are automatically expanded.

  2. Press and hold the Shift-key while double-clicking the instance path and the name of the variable (double-clicking the column Variable) for a variable in the view.
    Keyboard shortcut: Select the variable and press F2 or press and hold the Shift-key and press the Enter-Key.

  3. In the dialog, overwrite the text as requested and click images/download/thumbnails/414778889/ChangeVarName-version-1-modificationdate-1534413593345-api-v2.png so that the view displays the new variable instead of the original variable. Or click images/download/thumbnails/414778894/AddVar-version-1-modificationdate-1534413612854-api-v2.png , if you prefer that the view displays the new variable as well as the original variable.

  4. If the view does not show the current values for the variables: Load the application onto the PLC and start the execution of the application on the PLC.

If you have inserted an array variable into the view, complete the inserted item by the requested array subscripts. images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/information.svg If the instance path requires one or more array subscripts (i.e., the instance path contains one or several characters []), press the Enter-key in order to jump to the next position of the missing array subscript within the instance path.

There are the following possibilities to enter the missing array subscript:

  • Enter a single subscript.
    Example: ProgramInstance.arrayVariable[2] – Result: Only the element 2 is inserted into the Values of Variables view.

  • Enter an subrange.
    Example: ProgramInstance.arrayVariable[2..5] – Result: The elements 2 , 3 , 4 and 5 are inserted into the Values of Variables view.

  • Enter a list of subscripts and/or subranges.
    Example: ProgramInstance.arrayVariable[2..5, 7, 9] – Result: The elements 2 , 3 , 4 , 5 , 7 and 9 are inserted into the Values of Variables view.

For multi-dimensional array-variables the described possibilities may be applied for each dimension.
Example: ProgramInstance.arrayVariable[1..2, 7][2, 3] Result: The elements [1, 2] , [1, 3] , [2, 2] , [2, 3] , [7, 2] and [7, 3] are inserted into the Values of Variables view.

For array-elements located not at the end of the instance path, only single indices can be defined.
Example: ProgramInstance.arrayVariable[2..5].element not possible