How-to
Connect a ctrlX CORE as a PROFINET device to an IndraControl XM21
Short answer
A working IndraWorks login proves runtime access only. Cyclic I/O between an IndraControl XM21 and a ctrlX CORE flows once the PN-device address, the identical station name and the same input/output module order agree on both sides. Configure the XM21 as the PROFINET controller and the ctrlX CORE as a CODESYS Profinet device, set task priorities 37 and 30, and verify with a counter.

On this page
- Separate the engineering link from the PROFINET link
- Allocate the addresses and prove the subnet
- Configure the IndraWorks side as the PROFINET controller
- Configure the ctrlX side as the CODESYS Profinet Device
- Check both projects line by line
- Run the first exchange and watch the bytes
- What each result decides
- Questions asked
An IndraWorks login that succeeds tells you one thing: the engineering PC reached the XM21's PLC runtime. It is not evidence that PROFINET works. Treat the link between an IndraControl XM21 and a ctrlX CORE as two connections with two separate checks, and expect cyclic data only after three settings agree on both sides — the PN-device address reserved for the ctrlX device, the station name ctrlx-core-xcr in the example, and the module order, one 8-bit input followed by one 8-bit output. Configure the XM21 in IndraWorks as the PROFINET IO Controller, configure the ctrlX CORE in ctrlX PLC Engineering as a CODESYS Profinet Device, then run the verification sequence at the end before you trust a byte.
Separate the engineering link from the PROFINET link #
Engineering traffic and PROFINET traffic take different ports. The XM21's XF5 Ethernet port carries IndraWorks engineering; the ctrlX runtime address carries ctrlX PLC Engineering; the cyclic exchange itself runs between the XM21's RT-Ethernet extension-module interface and the ctrlX connection selected in the project, eth1 in the example. A passed login on the first link never proves the second: trace any switch between the RT-Ethernet port and eth1, check link state, and keep every engineering address separate from the PROFINET addresses.
| Link | Carries | Pass criterion |
|---|---|---|
| Engineering PC to XM21 port XF5 | IndraWorks project and download | Connection test in the Add Device wizard |
| Engineering PC to ctrlX runtime | ctrlX PLC Engineering login | Communication settings test passes |
XM21 RT-Ethernet to ctrlX eth1 |
PROFINET cyclic I/O | Link up plus the identity checks below |
PROFINET discovery and cyclic real-time traffic run at Ethernet level, so a passed ping proves nothing about the process-data path — the identity checks decide that.
Allocate the addresses and prove the subnet #
Fix the addresses before either tool opens. Example allocation: 192.168.10.1 for the XM21's PROFINET interface and 192.168.10.2 for the ctrlX PN device, both with subnet mask 255.255.255.0. Prove both sides share a subnet with the AND operation:
192.168.10.2 AND 255.255.255.0 = 192.168.10.0
192.168.10.1 AND 255.255.255.0 = 192.168.10.0
Both results land in 192.168.10.0/24, so a direct cable or one dedicated switch joins the two ports. Keep each engineering address outside the addresses in use on this segment: a reused address produces exactly the duplicate-IP failure described in fixing the CODESYS duplicate controller IP error in ctrlX PROFINET.
Configure the IndraWorks side as the PROFINET controller #
- Connect the engineering PC to the XM21's XF5 port and set a static address that reaches it. In IndraWorks create an empty project and add an IndraControl XM2 device by double-clicking it in the selection.
- In the Add Device wizard enter a device name, select the device release and communication type that match the installed controller, enter the XM21 engineering address, select the PLC gateway, and run the connection test — continue only when it passes.
- Leave Extended settings at their defaults. Under Function packages select only Programmable Logic Control. Under Interfaces set Extensionmodule to RT-Ethernet and sercos to SercosIII Master; the PROFINET frames leave through RT-Ethernet, not through the sercos interface. Finish the wizard.
- Right-click Not_Used, choose Set device, and select PROFINET IO Controller XM.
- Double-click PROFINET_IO_Controller_XM and open the General tab: enter the controller's PROFINET address and configure the device address range so it covers the address reserved for the ctrlX device.
- Install the ctrlX CORE device description: obtain the package through the manufacturer's channel, extract it, then open Tools → Device database, press Add devices, and select the XML. Without a packaged description, export the GSDML from the Device Repository — exporting the GSDML for a CODESYS PROFINET device shows the steps — and import the XML inside the generated archive,
GSDML-V2.42-CODESYS-CODESYS PLC-20210927.xmlin the documented export. The import route you take decides which CODESYS device repository entries appear, as why the GSDML install route decides CODESYS device repository entries explains. - Right-click PROFINET_IO_Controller_XM, choose Add, and double-click CODESYS Profinet Device in the I/O section. Open the new node, define the station name —
ctrlx-core-xcrin the example — and check the device IP address it shows. - Add the modules beneath the device: Input 8 Bit first, then Output 8 Bit. This sequence is the agreement the device checks, so fix it now and mirror it exactly on the ctrlX side.
Configure the ctrlX side as the CODESYS Profinet Device #
- Install the CODESYS Fieldbus communication packages for ctrlX CORE first, following the manufacturer's manual; the fieldbus is added from the Device node's context menu with Add Device once they are in place.
- Create a project from the ctrlX CORE template, right-click Device, open Communication settings, enter the ctrlX runtime address, and run the test.
- Choose Add device, open the PROFINET IO tab, select Ethernet Adapter → Ethernet, and add it. Double-click the new Ethernet node, press Browse to list the ctrlX network connections, and select
eth1. - Enter the PN-device address allocated earlier: 192.168.10.2 with subnet mask 255.255.255.0 in the example.
- Add CODESYS Profinet Device beneath Ethernet, open it, select Use project parameters, and enter the same station name configured on the IndraWorks side.
- Set the task priorities this pairing is documented with: 37 on Profinet_communicationTask and 30 on Profinet_IOTask. CODESYS PROFINET task priorities on a ctrlX CORE explains how those tasks interact with your own logic tasks.
- Add the same input and output modules beneath CODESYS_Profinet_Device, in the same order as the controller project. IndraWorks spells the two byte-wide modules with a space in the label, ctrlX spells them without — same modules, same sequence, different labels.
Check both projects line by line #
Compare the five settings that must agree before the first download:
| Setting | IndraWorks side | ctrlX side | Failure when mismatched |
|---|---|---|---|
| Device role | PROFINET IO Controller XM | CODESYS Profinet Device | No controller-to-device relationship |
| PN-device address | Address range covers it | 192.168.10.2 in the example | Device unreachable or address conflict |
| Subnet mask | Same network as the device | 255.255.255.0 in the example | IP communication fails |
| Station name | ctrlx-core-xcr |
Same name under Use project parameters | Connection cannot identify the station |
| Module layout | Input 8 Bit then Output 8 Bit | Input 8Bit then Output 8Bit | Configuration rejection or shifted process data |
PROFINET identifies the device by its station name when the controller establishes the connection, which is why a matching address with a different name passes discovery and still fails to exchange data. If the controller rejects the module configuration instead, the recorded module IDs are the next thing to verify.
Run the first exchange and watch the bytes #
- In ctrlX PLC Engineering, generate code, download to the ctrlX CORE, confirm with Yes, and press Run.
- In IndraWorks, log in to transfer the program to the XM21, confirm with Yes, and press Run.
- Give the bytes something to move: define a counter in UserVarGlobal, increment it in PlcProg, map
Application.PlcProg.inputon the I/O Mapping tab of Input_8Bit, and map the output variable the same way on Output_8Bit. - Watch Output_8Bit in ctrlX PLC Engineering — the values should follow the counter. IndraWorks shows the sent values too, so you can see which side stops.
Run the first pass on a bench or with the device terminals unwired: those eight bits land on real output terminals if the device is wired, and a counter driving them can start whatever is connected.
If Output_8Bit stays flat, perform a Reset cold and run again. If it still does not update, log out, select Enabled 2, log in and run; closing and reopening the output window, or another Reset cold, are the remaining moves.
What each result decides #
- Both runtimes run and Output_8Bit follows the counter: the cyclic path is proven — replace the counter with the real mapping.
- Login passes but no data flows: work the identity trio in order. Station name first, because identity fails at connection setup; then module order; then the PN-device address and its subnet.
- The device never appears in a scan or the Add dialog: the device description is missing or its repository import failed, so fix the description step on the IndraWorks side before touching anything else.
- Values appear only after Enabled 2 or a fresh window: an offline mapping view, not a PROFINET fault — the link was already carrying data.
A build that passes this sequence — address in one subnet, one station name on both sides, identical module order, priorities 37 and 30 — is the configuration to keep; anything that deviates fails at one of the five rows above.
Questions asked
Does this procedure also work with a ctrlX CORE X3 that is not the plus variant?
Yes. The same arrangement is documented for a ctrlX CORE X3 with an IndraControl XM21: the XM21 keeps the PROFINET IO Controller XM role and the ctrlX side keeps the CODESYS Profinet Device role, with identical address, station name and module order checks. Only the controller entry in the ctrlX project changes to match the non-plus hardware.
How do I read back the module IDs the controller reported to the device?
The ctrlX PROFINET device protocol stores the head station's used (sub)module IDs in the Slot0 parameter P-0-1682.0.2, shown with the IDN 0x2CF0:1B. When IndraWorks rejects the configuration or the process image looks wrong, compare those IDs against the module sequence under the CODESYS Profinet Device in the controller project; mismatched IDs explain a rejection or a shifted image.
Why does the PROFINET entry not appear when I add a device in ctrlX PLC Engineering?
The CODESYS Fieldbus communication packages for ctrlX CORE are not installed yet. Install them first; after that the fieldbus is added from the Device node's context menu with the Add Device command, and the PROFINET IO Ethernet adapter and device types appear in the selection. Obtain the packages through the manufacturer's documented channel.
Do the priorities 37 and 30 need adjusting when my program grows?
Set 37 on Profinet_communicationTask and 30 on Profinet_IOTask once per project, as the fieldbus setup recommends. They stay correct until you add your own cyclic or compute-heavy tasks; then check the ordering again so the PROFINET tasks keep their positions relative to the application, and confirm cyclic values still update after the change.

