FB_CX1010SetWatchdog

FB_CX1010SetWatchdog 1:

The function block FB_CX1010SetWatchdog activates a hardware watchdog on the CX1010. The watchdog is activated via bEnable = TRUE and the tTimeOut time. The tTimeOut time can be a minimum of 2 seconds and a maximum of 255 seconds.

Once the watchdog has been activated, the function block instance must be called cyclically at shorter intervals than tTimeOut, since the CX1010 restarts automatically when tTimeOut has elapsed. The watchdog can therefore be used to automatically reboot systems, which have entered an infinite loop or where the PLC has become stuck.

The watchdog can be deactivated via bEnable = FALSE or tTimeOut = T#0s.

Notice

The watchdog must be deactivated before breakpoints are used, before a PLC reset or an overall reset, before a TwinCAT stop, before switching to Config mode or before the configuration is activated, because otherwise the CX1010 would reboot immediately once tTimeOut has elapsed.

FB_CX1010SetWatchdog 2: Inputs

VAR_INPUT
    tTimeOut : TIME;
    bEnable  : BOOL;
END_VAR

Name

Type

Description

tTimeOut

TIME

Watchdog time, after which a restart is performed.

bEnable

BOOL

Activating/deactivating the watchdog.

FB_CX1010SetWatchdog 3: Outputs

VAR_OUTPUT
    bEnabled : BOOL;
    bError   : BOOL;
END_VAR

Name

Type

Description

bEnabled

BOOL

TRUE = Watchdog is active, FALSE = Watchdog is not active.

bError

BOOL

Error when activating or deactivating the watchdog.

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.0

CX (x86)

Tc2_SystemCX