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 that can suppress operations when executed:
- Online Change, Download
- Enable Breakpoint
- Reset Application, Stop Application
- Transmit Data
- Force Values, Write Values
In order that a backup solution is always in place, you are not permitted to suppress the Reset origin and Delete commands.
CODESYS will notify you if a currently disabled runtime system service is required when the application is in runtime mode. Then, you can respond with an appropriate countermeasure.
Function Block PlcOperationControl
for Operation Control
This function block is used for enabling and disabling operations.
Name | Data Type | Initial value | Description |
---|---|---|---|
xDisableApplicationOnlineChange |
BOOL |
FALSE |
TRUE : Online change is suppressed. |
xDisableApplicationDownload |
BOOL |
FALSE |
TRUE : Download is suppressed. |
xDisableApplicationStop |
BOOL |
FALSE |
TRUE : Application stop is suppressed. |
xDisableApplicationBP |
BOOL |
FALSE |
TRUE : Setting breakpoints is suppressed. |
xDisableApplicationWrite |
BOOL |
FALSE |
This can also be suppressed via PLCHandler/IecVarAccess. |
xDisableApplicationForce |
BOOL |
FALSE |
TRUE : Forcing variables is suppressed. |
xDisableApplicationReset |
BOOL |
FALSE |
TRUE : Resetting the application (not “Reset origin”) is suppressed. |
xDisableAll |
BOOL |
FALSE |
TRUE : All operations are suppressed. |
Implementing Operation Control
Requirement
- 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 (for example, “Stop Application”.- ⇒
PlcOpCtrl_Inst.xDIsableApplicationStop := TRUE;
See also