Heartbeat and Node Guarding
- Updated2025-10-10
- 1 minute(s) read
Use the heartbeat protocol or the node guarding protocol to detect device failures on a CANopen network. Heartbeat
The heartbeat protocol allows a device to indicate the current network management (NMT) state. This protocol is a producer/consumer protocol. A producer device autonomously transmits a heartbeat message at a specified interval. The heartbeat message indicates the NMT state of the device. One or multiple consumer devices receive the message. The consumer devices generate heartbeat events if these devices do not receive any heartbeat message within a specified time.
To use the heartbeat protocol on a device, you must set the value of the producer heartbeat time object to a non-zero value. Otherwise, the device does not transmit heartbeat messages to other devices. The index of this object is 1017h and the object data type is U16. This object determines the interval, in milliseconds, between heartbeat messages. Node Guarding
The node guarding protocol monitors the NMT state of a device. This protocol is a master/slave protocol. A master device transmits requests to a slave device. The slave device answers each request with a message indicating the NMT state and a toggle bit that varies at each response. The master device generates a node guarding event in the following cases:
- The slave device switches between different states.
- The slave device does not respond within a specified time.
- The toggle bit does not vary between two subsequent responses.