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 the
    Logical Value
    column, then in the dialog box, enter the required value and click
    Write
    .
  • 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 click
    Write
    .
  • From the Structured Text (ST) editor, click the red underline and then click cam_fvv. In the
    Write Logical Value
    dialog box, enter the required value and click
    Write
    .
While connected, force the values of directly-represented variables.
To force the value of a variable
  1. From the
    Dictionary
    instance, locate the required variable.
  2. Write the required value in the respective value column:
    • For an input variable, write the value in the
      Logical Value
      column.
    • For an output variable, write the value in the
      Physical Value
      column if the variable is locked and write the value in the
      Logical Value
      column if the variable is unlocked.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal