Supported platforms: CODESYS 2.3, CODESYS 3.5

 

Monitoring CANopen Nodes With a CAN Tool

All CANopen devices must support the CANopen Network Management (NMT) protocol. The NMT protocol defines the communication behavior of the CANopen device with four different states:

-          Initialization

-          Pre-operational

-          Operational

-          Stopped

 

CANopen network master controls the communication state of other devices (NMT slaves) with NMT messages. NMT protocol also enables the monitoring of NMT slaves. For node monitoring, Heartbeat protocol is recommended by CAN in Automation (CiA).

 

According to CANopen Heartbeat protocol, a CANopen device indicates its current NMT state by cyclically sending a heartbeat message to other devices. The heartbeat message includes one byte that defines the current NMT state. The cycle time of a heartbeat message is called Producer Heartbeat Time and it can be configured to index 1017h.

 

The following table describes NMT states and corresponding values sent in heartbeat message:

NMT state

NMT state value (hex)

Description

Initialization (Boot-up)

00

A boot-up message is sent when node changes its state from Initialization to Pre-operational state

Pre-operational

7F

During this state, the device configuration and ID allocation via SDO (e.g. using a configuration tool) is possible.

Operational

05

Device application is running and the transmission of process data (PDOs) is possible. The device can use all supported communication objects.

Stopped

04

Device application is stopped. The device reacts only to NMT commands

 

When CAN bus is monitored by a CAN tool, NMT states of devices can be seen from the heartbeat message. For example,

Time [ms]

CAN message

Description

Power on

-

-

t

701, 1, 00

Node with ID 1h sends a boot-up message

t+1

702, 1, 00

Node with ID 2h sends a boot-up message

..

70A, 1, 00

Node with ID Ah sends a boot-up message

..

701, 1, 7F

Node-ID 1h changes its state to pre-operational

..

702, 1, 7F

Node-ID 2h changes its state to pre-operational

..

70A, 1, 7F

Node-ID Ah changes its state to pre-operational

..

000, 2, 01, 00

NMT start sent to all nodes (01 = start command, 00 = all nodes)

..

701, 1, 05

Node-ID 1h changes its state to operational state

..

702, 1, 05

Node-ID 2h changes its state to operational state

t+n [ms]

70A, 1, 05

Node-ID Ah changes its state to operational state

 

See also

 

 

Source file topic000810.htm

Last updated 21-Feb-2025