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 .
    For STRING variables, the following is additionally valid : You are able to enter special characters, such as umlauts, by using the keyboard. For CHAR variables, you must enter the appropriate three-character combination of the dollar sign ($) followed by two hexadecimal digits (see the glossary term "→character string literals" for some examples). If the value for the variable may consist of several lines: A text with several lines is possible – press Shift+Enter .
    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.