Forcing the Values of Variables
While connected or simulating, force or override the values of variables. These variables
can be user-defined or directly represented. The behavior of a variable is defined by its
logical value, physical value, lock state, and direction. When forcing the values of
variables, the value to overwrite depends on the direction of the variable. Force the values
of variables from these views:
- Local Variable dictionary
- Global Variable dictionary
- IEC 61131-3 language editors
- I/O wiring
- ISaVIEW
- Spy list
For locked variables, the values displayed in the
Logical Value
and Physical
Value
columns differ depending on their direction. Variable direction is determined
from the direct representation definition for the I/O wiring. Input Variable (Read) Behavior
Example: To force the temperature reading from a sensor.

Output Variable (Write) Behavior
Example: To force the closing of an actuator valve.

For variables with the write access value of false, lock access before forcing the values.
For variables with the write access value of true:
- From the desired variable view, double-click the variable's corresponding cell in theLogical Valuecolumn, then in the dialog box, enter the required value and clickWrite.
- From the Ladder Diagram (LD) and Function Block Diagram (FBD) editors, double-click the variable, then in the dialog box, enter the required value and clickWrite.
- From the Structured Text (ST) editor, click the red underline and then click
. In the
Write Logical Valuedialog box, enter the required value and clickWrite.
While connected, force the values of directly-represented variables.
To force the value of a variable
- From theDictionaryinstance, locate the required variable.
- Write the required value in the respective value column:
- For an input variable, write the value in theLogical Valuecolumn.
- For an output variable, write the value in thePhysical Valuecolumn if the variable is locked and write the value in theLogical Valuecolumn if the variable is unlocked.
Provide Feedback