Getting Started with CANopen Communication: Part 5

Getting Started with CANopen Communication: Part 5

“Whenever you encounter ‘unable to write, unable to read, configuration unsuccessful’, it is mostly an SDO issue.”—— Bald Engineer, years of experience summarized

In CANopen, anything related to configuration and parameters is closely tied to SDO:

  • Change mode (0x6060)

  • Change acceleration (0x6083)

  • Configure PDO (0x1600 / 0x1A00)

  • Set heartbeat time (0x1017)

  • Modify node ID (0x2000~)

  • Clear alarms (0x6040 bit7)

SDO is the only official way to read/write the object dictionary, serving as the “universal management interface” for drives.

This article discusses three main topics:

1️⃣ How SDO works 2️⃣ SDO upload (read)/download (write) process 3️⃣ Common SDO errors explained in detail

🟧 1. What is SDO? A concise explanation

SDO (Service Data Object) is the service interface for accessing the object dictionary.

It allows you to:

  • Find a parameter using Index + Sub-index

  • Perform read/write operations on parameters

  • Support data of arbitrary length

It is suitable for:

  • Configuration (one-time)

  • Parameter modification

  • Pre-start preparation

It is not suitable for:

  • Real-time control (due to its slowness)

Real-time control should use PDO.

🟧 2. Structure of SDO messages

SDO is a “point-to-point” communication consisting of two parts:

  • Client: Master (PC/controller)

  • Server: Node (drive, sensor)

SDO messages use fixed CAN IDs:

Type CAN ID
Request (Client → Server) 0x600 + NodeID
Response (Server → Client) 0x580 + NodeID

For example, if Node ID=8:

  • Send: 0x608

  • Receive: 0x588

🟧 3. Two modes of SDO: Expedited vs Segmented

1) Expedited mode

  • Data up to 4 bytes (8~32 bit)

  • Most parameters use this mode

  • One send, one receive, simple and efficient

Commonly written as:

60606040608360FF


Almost all are expedited.

2) Segmented mode

  • Data > 4 bytes

  • Used for downloading large objects (e.g., structures/strings/EDS file fragments)

  • Requires multi-frame segmented transmission

You generally won’t use it, but you must know it exists.

🟧 4. SDO download (write) process: The core of writing parameters

SDO write operation is called “Download”.

The most common 4-byte expedited write message is:

cs | IndexH | IndexL | Sub | data0 | data1 | data2 | data3


✔ Control byte cs values (most common):

Operation cs value Meaning
Write 1 byte 0x2F expedited, 1 byte
Write 2 bytes 0x2B expedited, 2 bytes
Write 4 bytes 0x23 expedited, 4 bytes
Write arbitrary (length specified) 0x21 segmented

For example, writing speed:

CAN ID=0x608 Data: 23 FF 60 00 E8 03 00 00   # 0x60FF = 1000
Device will respond:

CAN ID=0x588 Data: 60 FF 60 00 00 00 00 00   # Indicates write success

🟧 5. SDO upload (read) process: The essence of reading parameters

Reading parameters is called Upload.

Send:

40 indexL indexH sub 00 00 00 00
Received:
43 indexL indexH sub value...

For example, reading device name 0x1008:

Send: 40 08 10 00 00 00 00 00 Received: 43 08 10 00 58 59 5A 00   # "XYZ"

🟧 6. The most critical “success judgment” rule of SDO

No matter what you read or write, as long as the response packet is:

60 indexL indexH sub ...

It indicates success.

❌ If you receive:

80 indexL indexH sub error0 error1 error2 error3

Then it indicates failure.

The next section discusses error code analysis.

🟧 7. Complete analysis of SDO error codes

When the slave returns:

80 indexL indexH sub ERR0 ERR1 ERR2 ERR3

The error codes are:

Abort Code Description (simplified explanation for engineers)
0503 0000 Toggle bit did not alternate (often used in segmented transmission)
0504 0000 SDO protocol timeout (slave did not respond within the specified time)
0504 0001 Illegal or unknown Client/Server command
0504 0002 Block Transfer: Invalid block size
0504 0003 Block Transfer: Invalid sequence number
0503 0004 Block Transfer: CRC error
0503 0005 Memory overflow (insufficient internal memory in the slave)
0601 0000 Object not accessible (incorrect access method, e.g., trying to write an object that must be written in pre-operational state)
0601 0001 Attempting to read a write-only object
0601 0002 Attempting to write a read-only object
0602 0000 Object does not exist in the object dictionary (Index completely does not exist)
0604 0041 Object cannot be mapped to PDO
0604 0042 Number or length of mapped objects exceeds the 8-byte limit of PDO
0604 0043 General parameter incompatibility (often seen in non-standard mapping processes)
0604 0047 General device internal incompatibility (drive internally refuses mapping)
0606 0000 Hardware error causing object access failure
0606 0010 Data type mismatch, service parameter length mismatch (your write byte count does not match the object)
0606 0012 Data type mismatch, parameter length too large
0606 0013 Data type mismatch, parameter length too small
0609 0011 Sub-index does not exist
0609 0030 Value exceeds parameter range (common: write speed too high)
0609 0031 Value written is too large
0609 0032 Value written is too small
0609 0036 Maximum value less than minimum value (often seen when setting Min/Max parameters)
0800 0000 General error (internal drive error)
0800 0020 Data cannot be transmitted to application (write failed)
0800 0021 Local control prevents data transmission (internal state of drive does not allow)
0800 0022 Current device state prevents data transmission (e.g., Fault, Switch On Disabled)
0800 0023 Dynamic generation error of device dictionary / object dictionary file corrupted
0607 0010 Data type mismatch (most common error code in expedited)

Note: 0607 0010 and 0606 0010 are the most common programming stage errors, many vendors have different usages, here we retain the most frequently encountered 0607 0010.

The most common issues you encounter on-site are:

① 0607 0010 / 0606 0010 —— Incorrect byte count written (most common)

Used 0x2B (2 bytes) to write a 4-byte object, such as 6040/60FF/607A, etc.

Solution:

  • 4 bytes → use 0x23

  • 2 bytes → use 0x2B

  • 1 byte → use 0x2F

② 0601 0002 —— Attempting to write a read-only object

For example:

  • Writing 0x6041 (status word, read-only)

  • Writing feedback object

③ 0602 0000 —— Index does not exist (incorrect address)

For example:

  • 0x6060 written as 0x6006

  • 0x6083 written as 0x6803

④ 0609 0011 —— Sub-index does not exist

For example:

  • Writing sub=1 for 0x60FF (this object has no sub)

⑤ 0800 0022 —— Current device state does not allow access

Common situations:

  • Motor in fault

  • Switch on disabled

  • Not in operational state

⑥ 0800 0021 —— Local control lock

The drive is in an internal protection state, such as limit, brake, safety logic intervention.

⑦ 0604 0041 / 0042 —— PDO mapping error

Causes:

  • Mapping without disabling PDO

  • 8 bytes too long

  • Incorrect mapping order (sub0 must be zeroed → write value → then write sub0)

⑧ 0800 0000 —— Internal drive error

This type of error needs to be analyzed in conjunction with the vendor’s manual.

⑨ 0504 0000 —— SDO timeout

Causes:

  • Poor bus signal

  • Node did not respond

  • Baud rate/termination resistor error

⑩ 0503 0005 —— Memory overflow

Very rare, usually a firmware bug in the drive or a large number of block transfer failures.

🟧 8. Python SDO usage example (practical version)

✔ Write mode 6060:

node.sdo[0x6060].raw = 3       # Speed mode

✔ Write target speed:

node.sdo[0x60FF].raw = 1000

✔ Set motor acceleration:

node.sdo[0x6083].raw = 20000

✔ Read status word:

state = node.sdo[0x6041].raw

🟧 9. SDO vs PDO: The essential differences you must know

Type Usage Speed Channel
SDO Parameter configuration, pre-start settings Slow Point-to-point
PDO Real-time control, feedback Fast Broadcast

In summary:

SDO is responsible for “telling the device how to work”, while PDO is responsible for “keeping the device working continuously”.

🟧 10. Common pitfalls for engineers regarding SDO

  1. Clearly wrote 6040, but received no response (reason: node not in Operational)

  2. Wrote 60FF but nothing happened (reason: 402 state machine not enabled for Operation)

  3. Failed to write PDO-related objects (reason: PDO not disabled)

  4. Write failure returns 0x06070010 (incorrect byte count written)

  5. Wrote heartbeat 0x1017, device did not respond (device internal implementation varies)

  6. Simultaneously writing SDO to multiple nodes → very slow (SDO is inherently slow)

  7. Writing large amounts of data via SDO → should use segmented

If you are working on AGVs, robotic arms, or motor platforms, you especially need to pay attention to these.

🟦 Next article preview (Part 6)

PDO: The core of real-time control (mapping, transmission types, SYNC explained in detail)

Leave a Comment