In the field of industrial automation and motion control, you often hear terms like "CANopen," "distributed I/O," "PDO," and "SDO." For engineers just starting out, the CANopen protocol can often seem daunting — it is not as intuitive as simple serial protocols, nor does it pursue the speed of EtherCAT.
So, what exactly is CANopen? What core problem does it solve? And how does it make complex distributed control systems simple and efficient?
In a nutshell: CANopen is a high-level application protocol built on top of CAN bus hardware. Through a standardized communication mechanism and object dictionary, it enables PLCs, sensors, actuators, and other devices to "speak the same language" and work together efficiently. Distributed I/O is one of CANopen's most classic and widely used applications.
This article uses Ebyte's M31-U-CAN series CANopen distributed I/O slave module as a reference case to guide you into the world of the CANopen protocol from the ground up.
Imagine controlling the lighting of an entire building, the sensors and valves on a factory assembly line, or hundreds of data acquisition points in a large laboratory. The traditional approach is:
Point-to-point wiring: Every sensor requires a separate wire running back to the central controller (PLC). Cable quantities explode, costs are high, wiring is complex, and failure points are numerous.
Difficult to modify: If the device type changes or I/O points need to be added, the PLC program and hardware configuration must be reworked — a very cumbersome process.
CANopen divides the entire system into two parts: Master and Slave.
Master (typically a PLC or dedicated controller): Responsible for overall network management, sending control commands, receiving data, and handling faults.
Slave: These are the distributed I/O modules located at the device site. They do not handle complex logic directly but faithfully execute acquisition and output tasks.
Taking Ebyte's M31-U-CAN series CANopen distributed I/O slave module as an example, it addresses the following key needs:
| Need | Solution |
|---|---|
| Flexible expansion | Supports modular architecture, connecting up to 16 I/O expansion modules (including the host), with a maximum of 256 I/O points. Users can freely combine DI, DO, AI, and AO modules like building blocks. |
| Simplified wiring | All I/O modules connect to the master via a single high-speed CAN bus. One twisted pair (CAN_H and CAN_L) replaces hundreds or thousands of signal wires, drastically reducing wiring costs and improving reliability and noise immunity. |
| Plug-and-play | CANopen's standardized object dictionary and device description files (.eds files) allow I/O modules to be automatically recognized and configured by mainstream PLC software (such as CODESYS), enabling true plug-and-play. |
| Dimension | Description |
|---|---|
| Device Type | CANopen slave module |
| Expansion Capability | Supports up to 16 I/O expansion modules (including host) |
| I/O Types | DI (NPN/PNP), DO (Relay/PNP), AI (Differential current/voltage, single-ended current/voltage), AO (Current/Voltage) |
| Communication Interface | CAN interface + Ethernet port (for parameter configuration) |
| CAN Baud Rate | 1000k (default), 500k, 250k, 125k, 50k, 20k, 10k |
| CODESYS Support | Yes, device can be loaded via .eds file |
| Industrial Protection | ESD, surge, power reverse polarity protection, CE certified |
To understand CANopen, you first need to know its physical foundation — the CAN bus.
CAN Bus: A multi-master bus communication protocol using two wires (CAN_H and CAN_L) with differential signal transmission. It offers极强的 noise immunity and is a "veteran star" in industrial environments and automotive electronics.
CAN's Limitation: CAN only defines the physical layer and data link layer, but does not specify the application layer. This means you have to define what "data 0x12345678" means yourself. CANopen fully defines this on top of CAN.
CANopen's power lies in three core mechanisms:
This is the soul of CANopen. Every CANopen device (such as the M31-U-CAN slave module) has an internal "data table" — the Object Dictionary. Each row in the table is uniquely identified by a 16-bit Index and an 8-bit Sub-index.
This is not an abstract concept; it is the device's "data encyclopedia." For example, the M31-U-CAN slave module's object dictionary includes:
| Index | Description |
|---|---|
| 0x1000 | Device Type — tells the master "I am an I/O device" |
| 0x1001 | Error Register — reports current errors |
| 0x6000 | Digital Input — records the status of all digital input points |
| 0x6200 | Digital Output — controls the status of all digital output points |
| 0x6401 | Analog Input — records analog input values (e.g., 0-10V) |
| 0x6411 | Analog Output — controls analog output values (e.g., 4-20mA) |
This is why CANopen devices can achieve plug-and-play: the master reads the slave's object dictionary to know what type of device it is, how many I/O points it has, and what the parameters of each I/O point are.
Meaning: Process Data Object
Purpose: Used for transmitting real-time, periodic, small amounts of process data, such as:
Master → Slave: Control valve on/off (DO), output analog signals (AO)
Slave → Master: Read sensor temperature (AI), read button status (DI)
Features:
No protocol overhead: PDO data frames do not contain indexes internally; they are directly mapped to object dictionary registers
High efficiency and speed: The M31-U-CAN's internal bus cycle can reach as fast as 1ms, ideal for high-speed control scenarios
Multiple trigger modes: Supports asynchronous event triggering, synchronous cyclic triggering, and remote request triggering
Meaning: Service Data Object
Purpose: Used for transmitting non-real-time, configuration, and diagnostic data, such as:
Modifying slave device parameters (baud rate, node address)
Configuring PDO mapping (deciding which process data is transmitted via which PDO)
Reading device serial numbers, firmware versions, etc.
Features:
Acknowledgment mechanism: Question-and-answer style, reliable but slower
Large data volume: Can transmit multi-byte data
Let's simulate the process of turning on an LED using the M31-U-CAN slave module:
The PLC master sends an SDO request to the M31-U-CAN slave module, configuring its Receive PDO (RPDO) mapping object to 0x6200, sub-index 01 (Digital Output Channel 1).
The PLC tells the M31-U-CAN: "From now on, when you receive data from me via RPDO1, write it to the location 0x6200, sub-01."
When a user presses a button, the PLC needs to turn on the LED connected to the M31-U-CAN's DO channel 1.
The PLC sends a PDO message with the data portion being the binary value "0000 0001" (turning on the first output channel).
Upon receiving this PDO, the M31-U-CAN slave module, based on the mapping relationship configured earlier via SDO, automatically writes the data to Object Dictionary location 0x6200, sub-01.
The module's internal I/O driver circuit detects the register value change and immediately outputs a high level, turning on the LED.
Throughout this process, the master does not need to know the address 0x6200 during PDO communication — it only needs to know "send 8 bytes of data." This is the core of PDO's high efficiency.
Beyond standard CANopen functions, the M31-U-CAN offers several practical features:
Hardware Configuration: DIP switches allow easy setting of the CAN node address (1~127) and CAN baud rate (first 3 bits for baud rate, last 7 bits for node address).
CODESYS Integration: The knowledge base provides detailed steps on loading .eds files in CODESYS, adding a CANopen manager, adding the M31-U-CAN device, and configuring I/O mapping addresses. Once mapping is complete, download the PLC program to control the I/O.
Intelligent Fault Handling: Supports offline I/O fault output configuration. When a communication fault occurs, it can be configured to either maintain the current output state or execute a preset abnormal output state.
| Core Parameter | M31-U-CAN Series |
|---|---|
| Protocol Type | CANopen Slave |
| Node Address | 1~127 (DIP switch configurable) |
| CAN Baud Rate (kbps) | 1000, 500, 250, 125, 100, 50, 20, 10 |
| Internal Bus Cycle | Up to 1ms |
| I/O Types | DI (NPN/PNP, 1000Hz), DO (Relay/PNP), AI (Differential, 16-bit), AO (Current/Voltage) |
| Max Expansion Modules | 16 (including host) |
| Communication Interface | CAN, Ethernet (for configuration) |
| Supply Voltage | DC 9~36V (with reverse polarity protection) |
| Operating Temperature | -40°C to +85°C |
| Scenario | Specific Application | Why CANopen Fits |
|---|---|---|
| Smart Factory | Material handling systems, assembly lines | Distributed I/O就近采集传感器和控制执行器,减少布线,提高系统灵活性和维护性 |
| Robotics | Welding, spraying, handling robots | CANopen's motion control sub-protocol (CiA 402) defines standardized axis control commands for precise servo motor control |
| Renewable Energy | Solar farm monitoring, wind power | Distributed I/O modules分散采集大量太阳能面板的电压、电流、温度,通过 CANopen 网络汇总到中央监控系统 |
| Medical Equipment | CT scanners, patient monitoring systems | High noise immunity and real-time performance ensure data transmission accuracy and stability |
| Building Automation | Lighting systems, HVAC control | Saves cabling, easy installation and maintenance |
Complete Product Line: Ebyte offers a full range from CANopen distributed I/O slave modules (M31-U-CAN) to processor core boards and single-board computers for industrial control. Whether you need I/O or top-level computing and control, suitable solutions are available.
Deep Industrial Design Experience: The M31-U-CAN series features industrial-grade hardware design with multiple protection mechanisms including ESD, surge, fast transient burst, and power reverse polarity protection, ensuring long-term stable operation in harsh industrial environments.
Comprehensive Documentation: Ebyte provides detailed product manuals (User Manual V1.0) covering not only product specifications but also in-depth guidance on using CODESYS to load devices, configurable object dictionaries, and I/O function instructions — highly valuable for engineers during development and debugging.
Easy-to-Use Configuration Tools: Parameters such as I/O filtering, fault output states, and analog output ranges can be conveniently configured via PC software, lowering the usage barrier.
Q1: What is the fundamental difference between CANopen and Modbus?
A: Modbus typically operates in master/slave mode, where the master polls slaves one by one, resulting in lower efficiency. CANopen, based on CAN bus's multi-master特性, allows devices to actively send data (PDO event triggering), offering higher real-time performance and efficiency. Additionally, CANopen's object dictionary and PDO/SDO mechanisms make configuration and networking much more flexible than Modbus.
Q2: How do I configure the node address and baud rate of the M31-U-CAN?
A: Configuration is done via the device's 10-bit DIP switch. The first 3 bits set the CAN baud rate, and the last 7 bits set the node address (valid range 0~127). For example, all switches set to 0 indicates the default 1000k baud rate and node address 1.
Q3: What is the maximum number of I/O points the M31-U-CAN can support?
A: It supports modular expansion, with a maximum of 16 I/O expansion modules (including the host itself) and up to 256 I/O points. These expansion modules include DI, DO, AI, and AO types.
Q4: What communication protocol does this device use? Which mainstream PLCs does it support?
A: The device uses the standard CANopen protocol. Since CANopen is a standardized protocol, as long as your PLC or controller supports CANopen (e.g., via CODESYS or other CANopen master cards), it can communicate with the M31-U-CAN series.
Q5: How do I add the M31-U-CAN device in CODESYS?
A: The knowledge base provides detailed steps:
Install the .eds file in CODESYS via "Tools" → "Device Repository".
Add CANbus and CANopen_Manager sequentially in the project.
Right-click CANopen_Manager, select Add Device, search for "ebyte", find and add M31-xxxxxxxx-U-CAN.
The CANopen protocol, through its three pillars — the Object Dictionary, PDO, and SDO — transforms complex distributed control systems into something standardized, efficient, and easy to use. Ebyte's M31-U-CAN series is an excellent example of this technical being successfully implemented in industrial products.
Whether you are a beginner or an experienced engineer, mastering the principles of CANopen will open a new door on your journey in industrial automation.