---
name: "watchdog"
section: "9"
platform: "linux"
package: "linuxcnc-uspace"
version: "1:2.9.4-2+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/watchdog/9"
---

# watchdog(9)

monitor multiple inputs for a "heartbeat"

## NAME

watchdog - monitor multiple inputs for a "heartbeat"

## SYNOPSIS

**loadrt watchdog num\_inputs=*N***

You must specify the number of inputs, from 1 to 32.  Each input has a  separate timeout value.

## FUNCTIONS

- **process**

  Check all input pins for transitions, clear the **ok-out** pin if any input has no transition within its timeout period.  This function does not use floating point, and should be added to a fast thread.

- **set-timeouts**

  Check for timeout changes, and convert the float timeout inputs to int values that can be used in **process**.  This function also monitors **enable-in** for false to true transitions, and re-enables monitoring when such a transition is detected.  This function does use floating point,  and it is appropriate to add it to the servo thread.

## PINS

- **watchdog.input-n bit in**

  Input number n.  The inputs are numbered from 0 to **num\_inputs**-1.

- **watchdog.enable-in bit in (default: *FALSE*)**

  If TRUE, forces out-ok to be false.  Additionally, if a timeout occurs on any input, this pin must be set FALSE and TRUE again to re-start the monitoring of input pins.

- **watchdog.ok-out bit out (default: *FALSE*)**

  OK output.  This pin is true only if enable-in is TRUE and no timeout has been detected.  This output can be connected to the enable input of a  **charge\_pump** or **stepgen** (in v mode), to provide a heartbeat signal to external monitoring hardware.

## PARAMETERS

- **watchdog.timeout-n float in**

  **Timeout value for input number n.  The inputs are numbered from 0 to**  **num\_inputs**-1.  The timeout is in seconds, and may not be below zero. Note that a timeout of 0.0 will likely prevent **ok-out** from ever becoming true.  Also note that excessively long timeouts are relatively useless for monitoring purposes.

## LICENSE

GPL
