F_CX1000SetWatchdog
The function F_CX1000SetWatchdog activates a hardware watchdog on the CX1000. The watchdog is enabled with bEnable = TRUE and a timeout time. The minimum timeout time is a few times the cycle time in which the function F_CX1000SetWatchdog is called, the maximum timeout time is 65sec and 535 milliseconds.
Once the watchdog is activated, the function has to be called cyclically, because if the tTimeOut-time expires then the CX1000 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.
![]() | 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 CX1000 reboots immediately after the timeout time has expired! |
FUNCTION F_CX1000SetWatchdog : BOOL
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.