FB_C69xxSetWatchdog

FB_C69xxSetWatchdog 1:

The function block FB_C69xxSetWatchdog activates a hardware watchdog on the C69xx-PC. The watchdog is enabled with bEnable = TRUE and a timeout time. The minimum timeout time is 2 seconds, the maximum timeout time is 255 seconds.

Once the watchdog is activated, the function block instance has to be called cyclically, because if the tTimeOut-time expires then the C69xx-PC automatically reboots. The watchdog can be used to reboot the system if the PLC gets stuck (i.e. in an endless loop).

The watchdog can be disabled by bEnable = FALSE.

Note
Reboot

The Watchdog has to be disabled before using breakpoints, before a PLC reset or PLC reset all, before a TwinCAT Stop, a change to Config Mode or before activating the configuration, otherwise the C69xx-PC reboots immediately after the timeout time has expired!

FUNCTION_BLOCK FB_C69xxSetWatchdog

VAR_INPUT

VAR_INPUT
    tTimeout : TIME;
    bEnable  : BOOL;
END_VAR

tTimeOut: Watchdog time, if expired a reboot is automatically executed.

bEnable: Activate or deactivate the watchdog.

VAR_OUTPUT

VAR_OUTPUT
    bEnabled : BOOL;
    bError   : BOOL;
END_VAR

bEnabled: TRUE = Watchdog is activated, FALSE = Watchdog is not activated.

bError: Error when activate or deactivate the watchdog.

Requirements

Development environment

Target plattform

PLC Libraries to include

TwinCAT v3.0.0

PC (i386)

Tc2_SystemC69xx