FB_CX1030SetWatchdog

FB_CX1030SetWatchdog 1:

The function block FB_CX1030SetWatchdog activates a hardware watchdog on the CX1030. 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 CX1030 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.

FB_CX1030SetWatchdog 2:

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 CX1030 reboots immediately after the timeout time has expired!

FUNCTION_BLOCK FB_CX1030SetWatchdog

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.