F_CX9000SetWatchdog
The function F_CX9000SetWatchdog activates a hardware watchdog on the CX9000. 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_CX9000SetWatchdog 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 CX9000 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 CX9000 reboots immediately after the timeout time has expired! |
FUNCTION F_CX9000SetWatchdog : 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 | CX (ARM) | TcSystemCX9000.Lib |