Command Force values
Symbol:
Function: The command permanently sets the value of a variable on the controller to a predefined value.
Call: Menu PLC, TwinCAT PLC Toolbar Options
Requirement: The PLC project is in online mode.
CAUTION | |
Material damage and personal injury due to unexpected behavior of the controlled system Changing the values of variables in a PLC program running on the controller can lead to unexpected behavior of the controlled system. Depending on the controlled system, damage to equipment and workpieces can occur or people's health and lives may be endangered.
|
With this command, TwinCAT permanently sets one or more variables of the active application on the controller to defined values. This setting is carried out at the beginning and end of each processing cycle. Order of execution: 1. Read inputs, 2. Force values, 3. Execute code, 4. Force values, 5. Write outputs.
You can prepare values by
- clicking in the prepared value field in the declaration part and entering the new value. For a Boolean variable, change the value by single-clicking in the field.
- Click the inline monitoring field in the implementation part of the FBD/LD/IL editor and enter the new value.
- Click in the prepared value field in the Monitor window and enter the new value.
A "forced" value is marked with an .
TwinCAT performs forcing until it is explicitly cancelled by the user through
- the command Unforce values
- cancellation of forcing via the Prepare Value dialog
- Logging out of the application
The command Force values for all applications, which affects all PLC projects in the TwinCAT project, is not included in a menu by default. |
See also: