IMDHMIControls LibraryShop main store

Explainer

Why an OPC UA write alone cannot command an EtherCAT drive

Drives and motion Published 8 min read By IMDHMI controls team

Short answer

No. An OPC UA write lands in the ctrlX Data Layer once, while an EtherCAT drive executes a process image the master retransmits every bus cycle — at a 1 ms cycle, 1,000 times per second — and takes a setpoint only after the CiA 402 enable sequence. A PLC, Motion, Python or Node-RED app between the OPC UA client and the EtherCAT master must own those cyclic outputs; the three apps alone do not close the chain.

On this page
  1. Can an OPC UA write command an EtherCAT drive directly?
  2. Why does one OPC UA write not hold a drive enabled?
  3. What does the drive state machine require before it takes a setpoint?
  4. What must the EtherCAT master do before the drive listens?
  5. What sits between the OPC UA client and the EtherCAT master?
  6. How do you test the command path without turning the shaft?
  7. What happens if the OPC UA connection drops while the bus runs?
  8. What runs the supervisory client at the machine?
  9. Questions asked

You can put an OPC UA Client app, Data Layer access and an EtherCAT master app on one ctrlX CORE and still not command the drive with a write alone. OPC UA is acyclic request/response under IEC 62541; EtherCAT process data is transmitted every bus cycle, and a converter takes a setpoint only after its drive profile state machine has been walked in order. Something on the controller — a PLC, Motion, Python or Node-RED app — has to own the cyclic outputs and the enable sequence. This page shows where a single write stops, what the missing component must do, and the test that proves the chain before the shaft turns.

Can an OPC UA write command an EtherCAT drive directly? #

No: an OPC UA write updates one Data Layer node once, while an EtherCAT drive executes the process data the master transmits every bus cycle, so a component on the controller must own the cyclic outputs and the enable sequence, and the three apps in your stack are not enough.

In your arrangement the third-party device runs the OPC UA server, the OPC UA Client app on the controller connects to it, and the write lands in a ctrlX Data Layer node. Under IEC 62541 that transaction is a client request answered by a server response: it happens when the client acts, not on any bus schedule. EtherCAT runs on a different discipline — the master transmits the configured process image every cycle whether or not anyone has written anything. The two timing domains meet only where a component copies the accepted request into the process image and sequences the drive's state machine. Without that component, the write stops at the Data Layer and the drive never sees it.

Why does one OPC UA write not hold a drive enabled? #

One write is one event: an EtherCAT bus configured for 1 ms transmits the drive's output image 1,000 times per second (1 s ÷ 0.001 s = 1,000 cycles), and one acyclic write covers a single instant of that stream, not the stream itself.

Worked example: at that cycle rate the converter receives its output process image 1,000 times per second, and a supervisory write that lands once sets the target for one of those 1,000 transmissions. The other 999 carry whatever the owning app last placed in the image; if nothing owns it, the bytes are whatever the master initializes them to, usually zeros, and zeros are not an enable. The repetition belongs to the master application at every cycle. OPC UA delivery runs at client, network and server pace and cannot supply it; the correct handoff is that the latest accepted request becomes an input to the component that cycles the drive command, which then keeps presenting valid process data whether or not another write ever arrives.

What does the drive state machine require before it takes a setpoint? #

The CiA 402 drive profile (standardized under IEC 61800-7) sequences every enable through the state machine in control word 0x6040, confirmed in status word 0x6041, and the drive takes a setpoint only after Shutdown, Switch On and Enable Operation are each confirmed in order.

That is what a converter enable actually is: not one bit, but a walk through power-stage states in which every step waits for the status word to confirm before the next control word value is written. A blind enable value written once, over OPC UA or any other route, does not perform the sequence, and a faulted drive stays latched until the fault is acknowledged. The operating mode object 0x6060 selects how the drive interprets the setpoint, so the mode value, setpoint scaling and units come from that converter's own documentation, not from the profile alone. The owning component has to run this sequence, read the status word at each transition, and keep presenting the last valid control word for as long as the setpoint stands. That cyclic duty is exactly what a single write cannot replace.

What must the EtherCAT master do before the drive listens? #

Before a single command byte reaches the drive, the EtherCAT master must initialize the sync managers and FMMU mappings and walk the slave through INIT, Pre-Operational, Safe-Operational and Operational; output process data is applied only in Operational.

The master sets up the sync manager channels that carry process data and the FMMU mappings behind them, then requests each state transition and checks that the slave confirms it. In Safe-Operational the slave reads its inputs and ignores its outputs, so a correctly formed command written during that stage is discarded and the write itself still succeeds. When writes look right but nothing happens at the drive, read the master's state diagnostics before anything else: a bus that has not completed its walk to Operational is the most common reason. Check topology and identity in the same pass — the configured slave order and identities must match what the scan detects on the wire. Only when the slave reports Operational does the cyclic exchange of command data begin, and from that moment the master transmits every cycle whether the application updates the image or not.

What sits between the OPC UA client and the EtherCAT master? #

A control component sits between them: a PLC app, a Motion app, a Python script or a Node-RED flow that reads your request from the Data Layer and writes the process image every cycle, because neither OPC UA nor the master app translates supervisory values into drive commands.

The Data Layer is the handoff point, and with the OPC UA client, the owning app and the EtherCAT master all touching one controller, the concurrent-access behavior of that layer is a configuration item; how it is set up is covered in configuring concurrent ctrlX CORE Data Layer app access. The owning app reads the request node or subscribes to it, validates freshness, walks the enable sequence and writes the mapped outputs every cycle. Where Python does that owning, the same placement question — where the OPC UA server sits relative to the code that reads controller data — is worked through in where an OPC UA server sits when Python reads PLC data. Assign exactly one writer per drive output: if a supervisory write and the cyclic task both target the mapped value, the cyclic task overwrites the write within one cycle, and a value that appears and instantly reverts is the signature of two owners.

How do you test the command path without turning the shaft? #

Test the whole chain with the drive inhibited: write a small test setpoint into the Data Layer node, confirm the owning app takes it up, then watch the control word walk through its transitions and the status word answer each one before any real speed is commanded.

Confirm first that the master reports the slave in Operational. Write a permitted test value into the request node and read it back through the Data Layer; if the write is rejected while reads work, the node-permission causes are the usual ones covered in why OPC UA writes fail while reads stay good. Next, check the owning app's cyclic output against the master's process image display or the drive's process data monitor. If the Data Layer value changes but the mapped output does not, the mapping or the owner is missing; if the output changes and reverts, a second writer owns it. Read the status word at each transition instead of trusting the write result: a successful write says the value was stored, not that the drive enabled. Release the drive to a real setpoint only when the full sequence has confirmed in the status word.

What happens if the OPC UA connection drops while the bus runs? #

The bus keeps running and the drive keeps executing the last values the owning app wrote: a retained nonzero velocity request survives an OPC UA disconnect, so the owning app must impose a stop on timeout, and hardwired or functional-safety channels, never OPC UA, carry the safety function.

EtherCAT has no reason to stop when the supervisory link fails: the master keeps retransmitting the process image and the drive keeps obeying it. The owning app therefore has to treat the request node as stale after a timeout you set for the process and write a commanded stop when it expires; the right value follows the machine's stopping behavior, not the protocol. Keep the emergency stop and every guard or safe-stop function on their own hardwired or functional-safety channels — OPC UA command delivery and the cyclic command path are ordinary control, and neither is a safety channel. Configure the drive's fieldbus watchdog in the same pass, because if the owning app itself stalls, the bus state and the drive's communication monitoring are the remaining lines of defense.

What runs the supervisory client at the machine? #

If the client issuing those writes is a PC at the machine, it is a selection like any other cabinet computer: a SCADA client that commands the drive belongs on an industrial panel PC built for the cabinet door or console, not on an office tower beside the controller.

The same choice applies to a gateway or logging host in the cabinet if your architecture adds one, though the ctrlX CORE itself usually fills that role. What decides this question is the count of applications, not the count of computers: OPC UA Client app, EtherCAT master app, and one owning app — PLC, Motion, Python or Node-RED — cycling the command. Decision, case by case: written as planned, with the client app, the Data Layer and the EtherCAT app and nothing between, the drive stays at rest because nothing performs the cyclic handoff or the state-machine walk; add the owning app and the same write becomes a supervisory request that the owner executes, which is the architecture that works and the one to build.

Questions asked

Is the 1 ms bus cycle a fixed EtherCAT requirement?

No. The cycle time is configured for the bus; 1 ms is the example used here, and many drive buses run 1 ms or faster. The rule does not move with the number: at whatever cycle you configure, the owning app must supply valid process data for every cycle, so a 2 ms bus halves the rate to 500 cycles per second and changes nothing about the handoff.

Can I write the Data Layer node fast enough to replace the owning app?

No. OPC UA writes cross a network and a server round trip each time, and even a 100 ms write loop, which is 10 writes per second, covers 10 of the 1,000 updates a 1 ms bus needs each second, with delivery jitter on top. Faster client loops add load without ever guaranteeing per-cycle ownership; the repetition has to happen on the controller, in the app that owns the process image.

Which app should own the drive when there is no PLC or Motion app?

A Python app or a Node-RED app can own it when it runs as a cyclic task on the controller: read the supervisory request from the Data Layer, validate it, walk the CiA 402 sequence and write the process image every configured cycle. Check its scheduling and its failure behavior before giving it that duty — a stalled owner leaves the last values on the bus — and keep the safety function off that path entirely.

Does the write reach the drive while the EtherCAT slave is still in Safe-Operational?

No. In Safe-Operational the slave reads inputs and ignores output process data, so an enable or setpoint written during that stage is discarded, and the write itself still reports success. When a correct-looking command produces no reaction at the drive, read the master's state diagnostics first: an unfinished state machine outranks node permissions and setpoint scaling as a cause.

Do I need an OPC UA server app on the controller as well?

It depends on direction. Your third-party device runs the server, so the controller needs only the OPC UA Client app to reach it; an OPC UA server app on the controller is needed when an external client must browse and write the ctrlX Data Layer from its own side. Neither direction removes the requirement: some cyclic component still owns the drive outputs and the enable sequence.

Keep reading

  • How-to

    Control a PowerFlex 525 drive from two PLC controllers

    Yes — add the PowerFlex 525 to the Logix controller's Ethernet tree and its command tags appear, but a cyclic drive connection has exactly one owner. Give the Logix controller that ownership, read the MicroLogix machine's request into it, and let one rung select the command the drive follows. Never let two controllers write the speed reference.

    Drives and motion

  • How-to

    Control a PROFINET servo drive with cyclic telegram data

    No motion library is needed when a PLC only exchanges cyclic process data with a PROFINET servo drive: import the device description, attach the drive, select the same telegram the drive is configured for, and map the words. Standard telegram 1, PZD 2/2, is two 16-bit words each way — four bytes per direction — and the PLC logic sequences control word STW1 and reads status word ZSW1.

    Drives and motion

  • How-to

    Interface an EFC5610 drive with a ctrlX CORE over EtherCAT

    The EFC5610 runs from a ctrlX CORE over EtherCAT once E8.00 = 1 and H3.40 = EC are set and the drive is rebooted, the ESI is installed, and the xFC01 device is scanned and downloaded. Command it with the Rexroth Mode decimals (128 activate, 129 run forward) and a frequency word scaled at 0.01 Hz per count, so 50.00 Hz is 5000 counts.

    Drives and motion