How-to
Set up CODESYS SoftMotion on ctrlX OS over EtherCAT
Short answer
Cable the EtherCAT slaves to the port with a standard Ethernet controller, assign the EtherCAT Master, SoftMotion 4 Axes and PLC licenses, install the CODESYS add-ons and the slaves' ESI files, then scan the bus, map the I/O with a loopback check and add a SoftMotion SoE axis for the drive.

On this page
Cable the EtherCAT slaves to the port backed by a standard Ethernet controller — XF51 on the X3 variants of a ctrlX OS device — assign the EtherCAT Master, SoftMotion 4 Axes and PLC runtime licenses, install the CODESYS EtherCAT and SoftMotion add-ons plus each slave's ESI description file, then scan the bus, map the I/O and add a SoftMotion SoE axis for the drive. The other X3 port, XF50, sits behind an FPGA that serves the drive family's own EtherCAT, and the CODESYS software stacks never run on it, so a coupler cabled there scans empty. Everything below is one concrete setup: an XB-EC-12 bus coupler with two I/O modules and a single-axis ctrlX DRIVE XCS-2, finished with a loopback jumper that proves the signal path in both directions.
Which port carries the CODESYS EtherCAT master #
The CODESYS EtherCAT master is a software protocol stack delivered as a PLC library, and a software stack can only push frames through a standard Ethernet controller. On an X3 variant, XF51 is the port that has one. XF50 is implemented as an FPGA that carries the drive family's own EtherCAT; the CODESYS soft stacks do not run there, and a slave cabled to XF50 never sees a frame from this master, which is why the scan returns nothing. Cable the bus coupler to XF51 and keep XF50 out of the PLC bus. On any variant other than X3, the silkscreen alone is not evidence: the device datasheet is where you confirm which physical port sits behind a standard Ethernet controller before cabling anything.
PLC Engineering then lists the port as an operating-system interface named eth1, eth2 and so on, and the master is bound by source MAC address. Read the MAC printed for each interface and pick the one that belongs to the port you cabled — a wrong interface produces exactly the same empty scan as a wrong port. The port naming shows up in other roles too; the walkthrough on configuring the ctrlX CORE XF51 port for a second Modbus TCP network is the same story from the network side. The master library itself is the one used in the guide to CODESYS SoftMotion over EtherCAT on a Raspberry Pi runtime; what differs here is which port the soft stack is allowed to bind to.
Licenses to assign on the device #
Three licenses go on the device before the first download: ctrlX OS License - CODESYS - EtherCAT Master (add-on), ctrlX OS License - CODESYS - SoftMotion 4 Axes, and a runtime variant such as ctrlX OS License - PLC Performance (02VRS+ / add-on) or any other license that runs PLC applications. Assign them through the licensing function of the ctrlX OS device itself. If a download later stops on a license exception, the fix for ctrlX PLC license invalid exceptions on download lists what to check, in order.
Add-ons and slave description files to install #
Two engineering-side add-ons come from the Collaboration Room, under Start > ctrlX AUTOMATION > ctrlX Store > CODESYS - PLC-Addons: CODESYS - EtherCAT and CODESYS - SoftMotion. Install them through the add-on installer in ctrlX PLC Engineering:
- Enable temporary administrator rights on the engineering PC.
- Open Tools → Add-on installer and run it in administrator mode.
- Close PLC Engineering once the installer window is open.
- Install both add-ons.
- Restart PLC Engineering.
The same installer flow is walked through in the article on installing and running CODESYS fieldbus add-ons in ctrlX.
The scan reads identity off the wire, but PLC Engineering needs each slave's ESI description — an .xml file, shipped on its own or as a .zip covering a device family — to know what the device can do and how its data is laid out. Without it, a discovered slave cannot be matched to a configurable device; that exact failure is the subject of the article on EtherCAT analog inputs unknown without ESI device description files. For this setup, obtain the ctrlX DRIVE EtherCAT SoE description package and the ctrlX I/O ESI file set (release 1.22.1 here), then open Tools → Device Repository, click Install, select the .xml files and click Install again. Descriptions go in before the first scan.
Working example: one bus coupler and one drive on XF51 #
The inputs, all from the setup this article is built around:
- Master: an X3-variant device running ctrlX OS, with the EtherCAT line on XF51.
- Slaves: one XB-EC-12 bus coupler, order number R911406090, carrying two I/O modules on its built-in contacts, and one single-axis compact ctrlX DRIVE XCS-2 cabled after the coupler.
- Licenses: the three listed in the previous section.
- Description files: the ctrlX DRIVE EtherCAT SoE package and the ctrlX I/O ESI set, release 1.22.1.
- EtherCAT task priority: 20.
The rule, in words: add the master as EtherCAT Master SoftMotion, scan the bus, copy every discovered slave into the project, map the coupler's channels in the EtherCAT I/O Mapping tab, enable SoftMotion on the root device, then add a SoftMotion SoE axis on the drive.
The arithmetic that judges the scan: a healthy line here must return exactly 2 EtherCAT slaves — 1 coupler + 1 drive = 2. The two I/O modules sit on the coupler's local contacts, so they appear as children of the coupler node and add nothing to the EtherCAT count. Read the scan dialog against that total. 0 slaves: no frame reached the line, which on an X3 variant means the port or the interface. 1 slave: the coupler answered but the cable on to the drive is open. 2 slaves: copy everything and continue.
The result in this setup: both slaves scan in, an output channel forced TRUE with Force Write comes back TRUE on the input channel jumpered to it, and green icons appear beside the devices after login.
The decision: two slaves plus a loopback input that follows its output proves the path end to end, so the axis work can start. Zero slaves means move the cable to the controller port and re-select the interface by MAC address before changing any other setting.
Scan the bus and map the I/O #
- Open ctrlX PLC Engineering through the ctrlX OS WebUI, so the new project already carries the correct device type.
- Right-click the device and choose Add device, then add EtherCAT Master SoftMotion from the list.
- Open EtherCAT_Task and set the task priority to 20; the editor rejects an invalid value at entry, so a wrong number cannot be saved.
- Select the master, choose the interface whose MAC address matches the cabled port (eth1, eth2 and so on), right-click and choose Scan for Devices, and log in to the device when prompted.
- Copy all discovered slaves from the result dialog into the project.
- Open the EtherCAT I/O Mapping tab of the coupler's modules and assign PLC variables to the channels, then log in: the login downloads the configuration and the PLC program, and live communication shows as green icons beside the devices in the project tree.
- Set a mapped output TRUE in the mapping tab or use Force Write, and with the jumper to an input channel, watch the input variable follow.
- Enable Always update variables in PLC Settings, so channels the program never references keep refreshing; without it, a loopback check on an otherwise unused channel can look dead.
Add the drive as a SoftMotion SoE axis #
Right-click the root device and choose Enable SoftMotion; velocity, position and torque commands are then handled inside the PLC task cycle. Right-click the ctrlX DRIVE and choose Add SoftMotion SoE Axis. SoE is Servo over EtherCAT, and the axis object is the interface between the motion function blocks and the drive hardware. Map the drive's variables in the same EtherCAT I/O Mapping tab so its control and feedback signals reach the PLC logic, then command the axis with the standard blocks: MC_Power to enable it, MC_MoveVelocity for speed, MC_MoveAbsolute for a defined position. If Add SoftMotion SoE Axis is not offered, the drive's SoE description is usually missing or does not match the installed SoftMotion add-on.
Drives that expose the CiA402 profile instead of SoE are commanded the same function-block way; the article on running CiA402 axes in structured text without an NC covers that case. One safety line before the first MC_Power on real mechanics: this setup proves communication, not safety — configure and validate the drive's stop behaviour and safety functions as a complete machine safety function per the drive documentation and the risk assessment.
Where the setup stops #
- Empty scan on an X3 variant: the slave is cabled to XF50, where the soft stack cannot transmit. Move the cable to XF51.
- Empty scan with the cable on the right port: the wrong interface is selected. Re-pick by source MAC address.
- Slaves appear in the scan but cannot be added: the ESI description is missing. Install the .xml files, then scan again.
- Add SoftMotion SoE Axis is not offered: the drive's SoE description is absent or incompatible with the installed SoftMotion add-on version.
Questions asked
Besides the priority of 20, which setting decides whether the EtherCAT bus runs reliably?
The bus cycle time, which the master device sets. It must be long enough for the EtherCAT task to finish every cycle and short enough for the application; the value that works depends on the coupler's and the drive's documented cycle limits, so take it from their datasheets instead of copying another project. The priority of 20 in the worked example is simply a valid value the editor accepts.
Does the second port on an X3 variant stop working once the master uses the controller port?
No. The FPGA port keeps serving the drive-family EtherCAT communication it was built for; only the CODESYS software stacks are limited to the port with the standard Ethernet controller. Cable the PLC bus to the controller port and leave the other port to its normal role. On variants other than X3, confirm from the datasheet which port has the standard controller, because the silkscreen does not show what sits behind it.
Are the licenses tied to the engineering PC?
No. The three licenses are assigned to the ctrlX OS device through its licensing function and stay bound to that device; the engineering PC only needs the EtherCAT and SoftMotion add-ons installed in PLC Engineering. That split is why a project can download to one licensed device without complaint and stop on a license exception on another device that has not been licensed.
What do the icons beside the devices in the project tree mean?
Green icons mean EtherCAT communication is live, which you only see after logging in, because the login downloads the configuration and the PLC program to the device. Icons that stay grey mean the master has no live bus: check that the slaves were copied from the scan dialog into the project, and that the master's interface still matches the MAC address of the cabled port.
Does the loopback jumper test every I/O channel?
No. It proves the whole path — master, interface, coupler, module — in both directions for the two channels it links. The remaining channels still need their own check: write or force each mapped output once and watch its variable, with Always update variables enabled so channels the program never references keep refreshing in the mapping tab.
