Explainer
Why a CANopen controlword is not a parameter-writing channel
Short answer
The CANopen controlword is object 0x6040, sixteen bits that request CiA 402 state-machine transitions through a mapped PDO; it has no room for a parameter index and value. Bind a 16-bit variable to it on the CANopen I/O Mapping tab and send 0x0006, 0x0007, then 0x000F to enable; write parameters over SDO instead.

On this page
- Can a CANopen controlword change a servo drive's parameters?
- What do the bits of the controlword mean?
- How do I put the controlword on the bus?
- Which controlword values enable the power stage?
- How do I change a real parameter instead?
- Do I need a function block to send the controlword?
- Why does my controlword variable change but the drive does nothing?
- Questions asked
The question behind a lot of stalled CANopen servo startups is whether the controlword can carry a parameter change into the drive. It cannot, and no function block changes that. Object 0x6040 is sixteen bits wide, and the CiA 402 profile gives every one of those bits a defined job: switch on, enable voltage, quick stop, enable operation, halt, fault reset. There is no index, no subindex and no value field, so nothing else can travel through it. The controlword earns its keep as process data instead: activate it in the drive's PDO mapping, bind a 16-bit application variable to it on the CANopen I/O Mapping tab, and run the state machine with that variable. Real parameter writes go over SDO, in their own confirmed transactions. The sections below give the bit meanings, the enable sequence with the arithmetic checked, the mapping steps, and the decision for each kind of write.
Can a CANopen controlword change a servo drive's parameters? #
No: the controlword is CiA 402 object 0x6040, a 16-bit word whose bits only request drive state-machine transitions, so it carries no parameter index, subindex or value and a real parameter change needs the CANopen SDO service instead.
CiA 402 is the CANopen device profile for drives and motion control, maintained by CAN in Automation for servo drives, inverters and stepper drives. It fixes the controlword at object index 0x6040, subindex 0, and spends all sixteen bits on the state machine.
A parameter write is a different structure. CANopen addresses every object dictionary entry by a 16-bit index plus an 8-bit subindex, and the value itself can run to 32 bits, so one parameter needs at least fifty-six bits of payload: sixteen plus eight plus thirty-two. The controlword offers sixteen bits with every bit already claimed. No encoding fits a parameter through that, and a function block cannot stretch the word either, because a block can only send objects the PDO mapping has placed on the bus. The decision: state commands ride the controlword, parameter values ride SDO, and neither substitutes for the other.
What do the bits of the controlword mean? #
Six of the sixteen bits do the driving: bit 0 switches on, bit 1 enables voltage, bit 2 permits the normal stop, bit 3 enables operation, bit 8 halts, and bit 7 resets a fault with a rising edge.
| Bit | Profile name | Setting it does |
|---|---|---|
| 0 | Switch on | Requests the step out of ready to switch on |
| 1 | Enable voltage | Requests power-stage voltage readiness |
| 2 | Quick stop | 1 permits the normal stop behavior, 0 requests a quick stop |
| 3 | Enable operation | Requests operation enabled, the state in which motion commands execute |
| 7 | Fault reset | A 0-to-1 edge clears a latched fault |
| 8 | Halt | Pauses the active motion function without leaving operation enabled |
Bits 4 through 6 are reserved, and bits 9 through 15 take mode-dependent meanings, such as new-setpoint handling in the profiled position and velocity modes; the drive manual lists them for each mode it supports. One trap sits on bit 2: writing it low requests a quick stop, so a careless controlword value can decelerate a running axis without you ever commanding a stop. Keep it high unless a quick stop is what you want.
How do I put the controlword on the bus? #
Activate the controlword entry in the drive's PDO mapping, then assign a 16-bit application variable to it on the CANopen I/O Mapping tab; from then on, every change of that variable is the controlword transfer.
- Open the drive's CANopen node in the project's device tree, under the controller.
- On the PDO mapping view, check that the controlword entry sits in an active receive-PDO, receive from the drive's side, because the controller produces the word and the drive consumes it. Tools label direction from different endpoints, so follow the data path rather than the input or output label.
- Activate the entry if it is inactive. Drives that support variable or dynamic PDO mapping let you rearrange entries; otherwise the default mapping from the drive's boot-up configuration applies, and the drive manual's PDO listing shows it.
- On the CANopen I/O Mapping tab, bind a 16-bit application variable to the controlword entry.
- Bind a second variable to the statusword entry in the transmit direction the same way; commands without feedback turn the state machine into an open-loop guess.
- Rebuild and download the configuration when the tool asks for it.
A device that bundles several motors runs one CiA 402 state machine per motor, so each axis gets its own bound controlword variable. For a click-path walkthrough of the same three settings, process-data mapping, acyclic parameter access and node addressing, the knowledge-base page on configuring CANopen: PDO, SDO and LSS setup covers all three in one place.
Which controlword values enable the power stage? #
Write 0x0006, then 0x0007, then 0x000F: shutdown, switch-on and enable-operation, the CiA 402 path from switch-on disabled to operation enabled, each step confirmed in the statusword before the next one goes out.
Worked example, for a drive whose manual follows the profile state machine; build each value from the bit table above:
- Shutdown, to ready to switch on: bit 1 plus bit 2: 2 + 4 = 6, written 0x0006.
- Switch on, to switched on: bits 0, 1 and 2: 1 + 2 + 4 = 7, written 0x0007.
- Enable operation, to operation enabled: bits 0 through 3: 1 + 2 + 4 + 8 = 15, written 0x000F, which in WORD notation is
2#0000_1111 = 16#000F = 15decimal.
The profile encodes each state in bits 0 through 6 of the statusword, and the confirmation is a masked comparison: (statusword AND 16#006F) = 16#0027 for operation enabled, with ready to switch on masking to 16#0021 and switched on to 16#0023. The mask keeps bits 0, 1, 2, 3, 5 and 6 and drops the vendor-variable bits above them, so 16#0027, thirty-nine decimal, means ready, switched-on and operation-enabled all true with quick stop permitted. Most drives also set the remote bit, bit 9, once they accept bus control, so the raw word often reads 16#0227 there.
A mapped statusword updates only when the drive's transmit-PDO fires, so state feedback is cycle-bound data, not an on-demand read; that same rule is why a PLC reads servo position only as cyclic data. If the sequence stalls between steps, the statusword shows where it stopped: drives that add vendor states, brake control for example, hold the machine in the extra state without raising a CiA 402 fault. Enable energizes a power stage that produces torque, so keep guards closed, emergency stop healthy and the motion request at a safe value while you test the sequence, under the machine's risk assessment.
How do I change a real parameter instead? #
Use an SDO write: it names the object index and subindex and carries the value in one confirmed acyclic transaction, which is exactly what sixteen bits cannot do; write it while the drive is disabled, and read it back before you trust it.
Objects up to 4 bytes transfer expedited in one message pair, longer ones in segments, and the drive answers with a confirmation or an abort code, never silence. During commissioning, write parameters from the configuration tool's object-dictionary view while the drive is disabled, then enable through the controlword. For a value the machine changes at runtime, call the controller library's SDO write service from the program, read the object back over SDO, and only then treat the new value as active. Some objects are write-protected while operation enabled is active; an SDO write that aborts with an access error is the object telling you it wants a different drive state, not a different controlword value.
| What you want to do | Channel | Why |
|---|---|---|
| Enable, disable, quick stop, fault reset | Controlword 0x6040 over a mapped PDO | State transitions are the sixteen bits' only defined job |
| Move the setpoint every cycle | Map target position 0x607A or target velocity 0x60FF beside the controlword | Setpoints are process data, not controlword payload |
| Change a commissioning parameter | SDO write from the configuration tool | Needs index, subindex and value in a confirmed transaction |
| Change a runtime parameter occasionally | SDO write from the program, then read back | Acyclic, confirmed, independent of the bus cycle |
Do I need a function block to send the controlword? #
No function block is needed for the transfer itself: the mapped variable assignment is the transmission, so a plain write of 16#000F to the bound variable carries the enable-operation command; you wrap your own block around the sequence only for interlocks and diagnostics.
The transport is the binding: when the mapped variable changes, the tool transfers the PDO at its configured event, on the SYNC object for synchronous PDOs or on change and on a timer for event-driven ones. A library block cannot rescue an entry that was never activated in the mapping, because it can only send what the bus layout carries. The block worth writing is your own, and it is small: it owns the three-step sequence, qualifies each step against the statusword mask, raises fault reset as a clean 0-to-1 edge, and refuses to enable while an interlock or the machine's permissive chain says no. Write it once, test it once on a safe axis, and every drive on the bus reuses it.
Why does my controlword variable change but the drive does nothing? #
Because a variable write only reaches a drive that consumes it: the usual causes, cheapest to check first, are an entry not activated in the PDO mapping, a stale download, a width mismatch, or a sequence that skips a required state.
- Entry not activated in the PDO mapping: your variable updates while the bus carries nothing. Confirm by comparing the drive's own controlword or status display, or a bus diagnostic, against your variable; a drive that never sees the value points here first.
- Configuration not rebuilt and downloaded: the project shows the new mapping while the node still runs the old layout. Confirm by rebuilding and downloading controller and fieldbus configuration, then checking the mapped entry again.
- Width or layout mismatch: a byte-wide variable on a 16-bit entry, or a rearranged PDO that only one side agrees with, puts bits in the wrong places. Confirm that the mapped type and width match the entry exactly and that both sides share one layout.
- Invalid transition: the state machine moves only on command patterns valid for the current state, so an enable value sent from switch-on disabled is ignored, not acted on. Confirm by masking the statusword: bit 3 set means a latched fault,
(statusword AND 16#006F) = 16#0060means switch-on disabled, and either one blocks the enable. - Permissives outside the word: a hardware enable input, an STO circuit or brake control can hold torque off while every mapped bit says enabled. Confirm in the drive's diagnostics: operation enabled in the statusword with no torque means the enable wiring and safety chain are the next stop, not the bus.
Enabled but motionless has causes beyond the state machine too, operating mode and setpoint among them; we worked one such case through in a CiA 402 axis that reads position but stays motionless.
Questions asked
How many objects can one PDO carry?
In CANopen over classic CAN a PDO transfers up to 8 data bytes, so a typical receive-PDO packs the 16-bit controlword beside a 16-bit or 32-bit setpoint. Both the controller and the drive must agree on one layout, and the drive's object dictionary and manual decide which entries it accepts in that slot.
What does the drive do with a controlword value that fits no transition?
It ignores it. The CiA 402 machine changes state only on the command patterns the profile defines for the current state, so an enable-operation value sent from switch-on disabled leaves the drive where it was. The statusword confirms nothing moved, and the rejected value alone raises no fault.
Can I write drive parameters while the drive is enabled?
Only where the object allows it. Each object dictionary entry carries access attributes, and many commissioning parameters are write-protected while operation enabled is active, so an SDO write that aborts with an access error is expected behavior rather than a bus fault. Move the write to a disabled state, or pick an object the drive marks writable in operation, and confirm with an SDO read-back.
Which objects usually ride beside the controlword in a drive's PDOs?
The statusword 0x6041 is the essential companion in a transmit-PDO; setpoints such as target position 0x607A, target velocity 0x60FF and the modes-of-operation command 0x6060 typically fill the receive-PDO beside the controlword. The drive manual's PDO listing shows the default layout before you add or move anything.
