F_CP66xxSetWatchdog
The function F_CP66xxSetWatchdog activates a hardware watchdog on the CP66xx-xxxx-0000. 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_CP66xxSetWatchdog is called, the maximum timeout time is 64sec and 431 millisec.
Once the watchdog is activated, the function has to be called cyclically, because if the tTimeOut-time expires then the CP66xx-xxxx-0000 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 CP66xx-xxxx-0000 reboots immediately after the timeout time has expired! |
FUNCTION F_CP66xxSetWatchdog : 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.
Requirements
Development environment | Target platform | PLC Libraries to include |
---|---|---|
TwinCAT v2.10.0 | CP66xx-xxxx-0000 (ARM) | TcSystemCP66xx.Lib |