Skip to main content

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.

Table 7. Property (PROPERTY)

Name

Data Type

Initial Value

Description

xDisableApplicationOnlineChange

BOOL

FALSE

TRUE: Online change suppressed

xDisableApplicationDownload

BOOL

FALSE

TRUE: Download suppressed

xDisableApplicationStop

BOOL

FALSE

TRUE: Application stop suppressed

xDisableApplicationBP

BOOL

FALSE

TRUE: Setting of breakpoints suppressed

xDisableApplicationWrite

BOOL

FALSE

TRUE: Writing of variables suppressed

This can also be suppressed via PLCHandler/IecVarAccess.

xDisableApplicationForce

BOOL

FALSE

TRUE: Forcing of variables suppressed

xDisableApplicationReset

BOOL

FALSE

TRUE: Reset of the application (not "Reset Origin") suppressed

xDisableAll

BOOL

FALSE

TRUE: All operations suppressed



Implementing operation control

. Requirement
  • Compiler version >= 3.4.3.0

  • In the device description, the PLC operation control is enabled by system variables.

  1. Declare an instance of the PlcOperationControl function block (for example, PlcOpCtrl_Inst).

    PlcOpCtrl_Inst : PlcOperationControl;

  2. Suppress a command by assigning the respective TRUE property (example: "Stop Application").

    PlcOpCtrl_Inst.xDIsableApplicationStop := TRUE;