Controlword Cookbook: Every 0x6040 Bit and Command

The CiA 402 controlword at object 0x6040 is the 16-bit value a PLC or motion master writes to a servo drive to command state transitions and per-mode behaviour. Every conforming drive on CANopen, EtherCAT (CoE), POWERLINK, or Sercos honours the same bit layout. This is the cookbook: every bit, every canonical command value, every mode-specific handshake.

TL;DR

Send 0x0006 → 0x0007 → 0x000F to bring a drive from Switch On Disabled to Operation Enabled. Use 0x0080 as a rising edge to reset faults. Hold bit 2 low (0x0002) to quick-stop. Clear bit 1 (0x0000) to disable voltage and coast.

What the controlword is

The controlword is defined by IEC 61800-7-201 / CiA 402-2. It is a single 16-bit object (0x6040, sub-index 0, UNSIGNED16). The master writes it; the drive reads it and acts on the transition logic. Bits 0–3 drive the DS402 state machine, bit 7 resets faults, bit 8 halts motion, bits 4–6 and 9 are operation-mode specific, bits 10–15 are reserved or manufacturer-specific.

Bit-by-bit reference

Bit Label Name When you set it
0 SO Switch On Part of the core transition pattern.
1 EV Enable Voltage Must be 1 to leave Switch On Disabled. 0 coasts the motor.
2 QS Quick Stop Active-low. 0 commands Quick Stop; 1 means no quick stop.
3 EO Enable Operation Together with SO+EV+QS, puts the drive in Operation Enabled.
4 OMS Op-mode specific PP: New Setpoint. HM: Start Homing. IP: Enable Interpolation.
5 OMS Op-mode specific PP: Change Set Immediately.
6 OMS Op-mode specific PP: Absolute (0) / Relative (1).
7 FR Fault Reset Edge-triggered on 0→1. Clears the latched fault.
8 H Halt Stops motion per 0x605D without leaving Operation Enabled.
9 OMS Op-mode specific PP: Change on Setpoint.
10 R Reserved Shall be 0.
11–15 MS Manufacturer Vendor-defined. EPOS4: endless movement. Copley: input shaping.

Click these bits into the controlword calculator to verify.

Canonical command values

These are the six values your code will actually send. Memorise them.

Command Hex Dec Binary Result
Disable Voltage 0x0000 0 0000 0000 0000 0000 → Switch On Disabled, motor coasts
Shutdown 0x0006 6 0000 0000 0000 0110 → Ready to Switch On
Switch On 0x0007 7 0000 0000 0000 0111 → Switched On
Switch On + Enable Operation 0x000F 15 0000 0000 0000 1111 → Operation Enabled
Quick Stop 0x0002 2 0000 0000 0000 0010 → Quick Stop Active
Fault Reset (pulse) 0x0080 128 0000 0000 1000 0000 Fault → Switch On Disabled

Startup sequence

Shutdown → Switch On → Enable Operation

A drive that just powered up lands in Switch On Disabled. To make it run:

  1. Write 0x0006 (Shutdown). Wait for statusword bit 0 = 1 (RTSO). State → Ready to Switch On.
  2. Write 0x0007 (Switch On). Wait for statusword bit 1 = 1 (SO). State → Switched On. Output stage closes.
  3. Write 0x000F (Enable Operation). Wait for statusword bit 2 = 1 (OE). State → Operation Enabled. Drive now accepts motion commands.

Some drives tolerate sending 0x000F directly from Switch On Disabled; most do not. Always walk the full sequence for portability.

Fault recovery

When a rising edge matters (bit 7)

Fault Reset is defined as edge-triggered 0→1. Practical consequence: if you set CW = 0x0080 on master init and leave it there, the first fault clears, every subsequent fault does not. Pulse the bit.

Typical pattern: write 0x0080, wait ≥10 ms, write 0x0000 or 0x0006. Some masters go 0x0086 → 0x0006; the logic is the same.

If the fault does not clear, the cause is still present. Read 0x603F (Error Code) for the fault number and consult the drive manual.

Halt, Quick Stop, Disable Voltage — when to use which

Method Behaviour Leaves Op Enabled? Use for
Halt (CW.8 = 1) Decel per 0x605D, stays in Op Enabled No Coordinated stops; resumable.
Quick Stop (CW.2 = 0) Decel per 0x605A, leaves Op Enabled Yes (→ QSA → SOD) Safety-adjacent stops.
Disable Voltage (CW = 0x0000) Motor coasts immediately Yes (→ SOD) True emergency, or fault recovery.

Halt is the right default for user-initiated "stop the motion". Quick Stop and Disable Voltage are for fault handling and emergency flow.

Mode-specific bits

CSP — Cyclic Sync Position

CW bits 4–9 are reserved. Cyclic modes consume position targets from 0x607A every cycle; the handshake bits of PP are not used. Statusword SW.12 (Drive Follows Command Value) is the truthful "I am tracking" flag.

PP — Profile Position: the new-set-point handshake

Profile Position uses CW.4 / SW.12 as a handshake:

  1. Master loads 0x607A (Target Position) and profile parameters (0x6081, 0x6083, 0x6084).
  2. Master sets CW.4 = 1 (New Setpoint).
  3. Drive latches the setpoint, sets SW.12 = 1 (Setpoint Acknowledge).
  4. Master clears CW.4 = 0.
  5. Drive clears SW.12 = 0. Ready for the next setpoint.

Skipping the handshake is the single most common cause of "PP mode only moves on the first setpoint".

HM — Homing

CW bit 4 is the Start Homing trigger. SW bits 10/12/13 decode as: 00 = in progress, 10 = attained and at standstill, 01 = error, 11 = attained but not at standstill yet.

Manufacturer deviations

Short list of the most common surprises:

  • EPOS4: bit 11 toggles endless movement in PP.
  • AKD: 0x000F alone is not enough; the HWENABLE hardware input must also be high.
  • Siemens SINAMICS on PROFIdrive: you are writing STW1, not 0x6040. Bit meanings differ entirely.
  • Delta ASDA (older firmware): tolerates bit 7 held high instead of edge-triggered. Newer firmware tightened this. Always pulse.
  • Elmo Gold (older firmware): Operation Enabled + MO=0 = output stage off. Send MO explicitly.

FAQ

What is the CiA 402 controlword? A 16-bit value at object 0x6040 that the master writes to a servo drive to command DS402 state transitions and per-mode behaviour.

What controlword enables a servo drive? Send 0x0006 (Shutdown), then 0x0007 (Switch On), then 0x000F (Enable Operation). The drive lands in Operation Enabled and will accept motion commands.

How do I reset a CiA 402 fault? Pulse controlword bit 7 (value 0x0080), then write 0x0000 or 0x0006. Bit 7 is edge-triggered.

What is the difference between Quick Stop and Halt? Halt (CW.8) decelerates while keeping the drive in Operation Enabled — motion is resumable by clearing the bit. Quick Stop (CW.2 = 0) leaves Operation Enabled and normally ends in Switch On Disabled.

Why is bit 2 active-low? So that a disconnected master (controlword = 0x0000) naturally commands a safe stop instead of accidentally running the drive.

Try it

Build and decode controlwords →

The decoder lets you click bits to build a value, then see exactly which state a drive that received it would land in.

Related Tools

More Articles

Browse All Articles