Changing the values of variables: writing values to PLC

How to change a value of a →variable in Values of Variables view in order to write it to the →PLC:

  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. Double-click a value (double-click the column Value) for a variable in the view. Alternative: Select the variable and press the Enter-Key.
    Result: A dialog is opened to change the value. Here the dialog for the INT variable count:

    images/download/attachments/414778879/VariablesValue_Edit-version-1-modificationdate-1534413394242-api-v2.png
  3. In the dialog, enter or select the new value and click images/download/attachments/405733757/SetVar-version-1-modificationdate-1529910884916-api-v2.png . If you want to enter special characters, such as umlauts, for STRING or CHAR variables, you have to enter a three-character combination of the dollar sign ($) followed by two hexadecimal digits (details: see examples under →character string literal).
    Result: The new value is written to the PLC. The Values of Variables view displays the new value.

    No Forcing

    Observe that the processed application may overwrite your value at any time because this change of the value is no forcing. See " Forcing the values of variables ", if you want to force a variable.

Good to know

As alternative, it is also possible to change the values within the ST-viewer. See "Monitoring and changing values in viewer or editor" for this possibility.