The CANopen protocol is a high-level communication protocol based on the CAN bus, maintained and standardized by the CiA international user and manufacturer organization. The core goal of the CANopen protocol is to define a network layer and application layer specification for embedded systems, ensuring seamless interconnection and interoperability of devices from different manufacturers on the same CAN bus. Having introduced an overview of the CANopen protocol stack, this article will delve into the principles, state machine mechanism, and practical application scenarios of NMT network management within the CANopen protocol stack, helping engineers and developers master this core technology.
I. Introduction to NMT Network Management
The NMT is the control center of the CANopen network, responsible for managing the lifecycle and operating status of all devices in the network. It determines when each device starts, runs, and stops, ensuring the coordinated and orderly operation of the entire system. NMT typically adopts a master-slave architecture, with one NMT master managing up to 127 NMT slave devices.
NMT Master: Typically a PLC, industrial computer, or dedicated controller, responsible for unified network management;
NMT Slave: Individual CANopen devices in the network (such as servo drives, I/O modules, sensors, etc.). II. NMT State Machine Analysis
Each CANopen device follows a predefined NMT state machine. Devices exhibit different behaviors and communication capabilities in different states. The NMT master station controls the state transitions of slave stations by sending NMT commands.
1. Initialization
• Description: This internal state is entered first after the device powers on or receives a reset command, performing self-tests, hardware initialization, firmware loading, etc.
• Behavior: After initialization, the device sends a Bootup message (COB-ID 0x700 + Node-ID, data [0x00]) to inform that the network has started, and then automatically enters the Pre-operational state.
2. Pre-operational
• Description: The default state entered after device startup, with limited functionality, mainly used for network configuration and diagnostics.
• Behavior: The device can respond to NMT commands and SDO requests/responses, but PDO communication is prohibited. The master station is allowed to safely configure PDO mappings, communication parameters, etc.
3. Operational
• Description: The device is in normal operating condition; all functions are activated.
• Behavior: The device supports all communication objects, can send and receive process data normally, and executes pre-defined application tasks. The master station typically sends a Start Node command to switch the device from Pre-operational to this state.
4. Stopped
• Description: A safe state, usually triggered by the master station sending a Stop Node command.
• Behavior: The device stops all application execution and all PDO communication. It will still respond to NMT commands and send Heartbeat messages, but will not send or receive PDO data. This state is commonly used for emergency shutdown, maintenance, or safe disconnection of the device.
III. NMT Command Examples

The NMT command is issued by the NMT master station. The COB-ID is fixed at 0x000, and the data includes the command code and the target Node-ID.
1. Application Scenario Overview
The master station wants to put Node-ID 0x10 into the Operational state.
2. CAN Frame
• COB-ID: 0x000 (The fixed COB-ID of the NMT command, highest priority);
• Data: [0x01, 0x10]
◦ 0x01 is the NMT command code, indicating "Start Node".
◦ 0x10 is the target Node-ID, indicating that this command is only for the device with Node-ID 0x10.
3. Other Common NMT Command Codes
• 0x02: Stop Node;
• 0x80: Enter Pre-operational;
• 0x81: Reset Node (including application and communication layers);
• 0x82: Reset Communication (only the communication layer is reset).
4. Broadcast Commands
If the target Node-ID of an NMT command is 0x00, it indicates that the command is a broadcast command, and all slaves in the network will execute the command (e.g., [0x01, 0x00] will start all nodes).
NMT network management is the cornerstone mechanism of the CANopen protocol. Its master-slave architecture and strict state machine design bring many advantages to industrial networks. It provides explicit state transition rules, ensuring deterministic system behavior; it has emergency stop and fault isolation capabilities, ensuring equipment and personnel safety; it supports online configuration and hot-swapping, providing flexible system maintenance capabilities; and its architecture, which allows a single master station to manage 127 slave stations, guarantees excellent scalability.
Mastering NMT is not only the key to understanding CANopen, but also an essential skill for developing highly reliable industrial communication systems. In practical projects, it is recommended to design state transition strategies based on specific application scenarios and fully utilize pre-operational states for parameter optimization to maximize the performance of the CANopen protocol.