PLC Operation Control via System Variables
Caution
You are responsible for runtime system services being enabled under safe application conditions and disabled only under critical conditions.
At runtime, the state of an application or facility can become sensitive and disruptive actions can endanger the entire machine or facility. However, in this state you can suppress certain commands and prevent dangerous actions. The PlcOperationControl function block and Component Manager library are provided for this purpose.
Examples of CODESYS commands which can suppress operations when executed:
Online Change, Download
Enable Breakpoint
Reset Application, Stop Application
Transmit Data
Force Values, Write Values
The Reset Origin Device command cannot be deactivated so that you cannot completely lock yourself out of the runtime system. This command is the last option for opening a completely locked runtime system where all critical operations are deactivated. This is usually acceptable because this command requires extended permissions in the device user management.
CODESYS will notify you if a currently disabled runtime service is required at application runtime. Then, you can respond with an appropriate countermeasure.
PlcOperationControl Function Block for Operation Control
The function block is used for enabling and disabling operations.
Name | Data Type | Initial Value | Description |
---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This can also be suppressed via PLCHandler/IecVarAccess. |
|
|
|
|
|
|
|
|
|
|
|
|
Implementing operation control
Compiler version >=
3.4.3.0
In the device description, the PLC operation control is enabled by system variables.
Declare an instance of the
PlcOperationControl
function block (for example,PlcOpCtrl_Inst
).PlcOpCtrl_Inst : PlcOperationControl;
Suppress a command by assigning the respective
TRUE
property (example: "Stop Application").PlcOpCtrl_Inst.xDIsableApplicationStop := TRUE;