Using a hardware watchdog

The function block FB_PcWatchdog_BAPI activates a hardware watchdog on the Embedded PC. The watchdog can be used to automatically restart systems that have entered an infinite loop or where the PLC has stopped.

The watchdog is activated with bExecute = TRUE and nWatchdogTimeS >= 1s.

Once the watchdog has been activated, the function block must be called cyclically and at shorter intervals than nWatchdogTimeS, because the Embedded PC automatically restarts if the set time is less than nWatchdogTimeS.

Notice

Unwanted restart

The watchdog restarts the Embedded PC as soon as the time set for nWatchdogTimeS elapses.

Be aware of this behavior and disable the watchdog if you use breakpoints, carry out a PLC reset or an overall reset, stop TwinCAT, switch to config mode or activate the configuration.

Requirements:

Locating the function block in TwinCAT:

1. Double-click on Tc2_System in the tree view under PLC > PLC project > References.
The Library Manager appears.
Using a hardware watchdog 1:
2. Under Tc2_System > POUs > SYSTEM +TIME click on the function block FB_PcWatchdog_BAPI.
The description of the function block can then be found under the Documentation tab or in the library description under: FB_PcWatchDog_BAPI. If necessary, you can install the Tc2_System library at a later stage via the Add Library button in the Library Manager.