IMDHMIControls LibraryShop main store

Troubleshooting

Fix CODESYS EtherCAT master adapter open error on PFC200

Industrial networks Published 5 min read

Short answer

The error is fixed by the whole port configuration: PFC200 firmware 26, the two Ethernet ports separated, the EtherCAT port on its own network segment, a reboot, and ethX2 as the master's source adapter. Unswitched ports alone keep the error. With the master running, PDO reads and writes to the drive need no license; only an axis technology object does, so a torque-mode move is done through the drive's PDOs directly.

On this page
  1. What the adapter error is telling you
  2. The fix that cleared it on the PFC200
  3. Separate segments and the subnet arithmetic
  4. The same message on Windows and USB adapters
  5. PDO access works without the motion license
  6. Decision: torque mode by direct PDO control
  7. Questions asked

On a WAGO PFC200, the message "Preparation was not successful: could not open network adapters" is not cleared by the adapter name alone. In the reported setup the error went away only when the controller ran firmware 26, the two Ethernet ports were separated with the EtherCAT port on its own network segment, the controller was rebooted, and ethX2 was set as the master's source adapter; making the ports unswitched without the rest changed nothing. Once the master runs, reading and writing the servo drive's PDOs needs no license. Only adding an axis technology object does, so a simple torque-mode move is done by writing the drive's PDOs directly.

What the adapter error is telling you #

The text comes from the IoDrvEtherCAT library while the EtherCAT master prepares, before any cyclic process data exists. It means the runtime could not open the selected adapter for the master's raw frames. Servo tuning, the PDO mapping and the drive's parameters play no part yet; a wiring fault would not produce this message either, because the stack never got as far as sending anything. The reported setup connected a DELTA EtherCAT servo drive to port X2 and still failed with ethX2 correctly selected.

The decisive condition is that the master must bind to an interface the controller exposes as independent. When the two Ethernet ports are switched together into one logical network, the name ethX2 can exist in the adapter list and still not be openable the way the EtherCAT stack requires.

Errors after a successful start are a different subject. A cable pull that leaves the error flag false is covered in why a CODESYS EtherCAT master's xError stays false on cable pull. The running-state timing problem is covered in why a CODESYS EtherCAT master loses synchronicity.

The fix that cleared it on the PFC200 #

  1. Update the controller to firmware 26. The failing project used the device description for firmware 25 or above, and separating the ports on that firmware still left the error.
  2. In the controller's web-based management, open the "Configuration" > "Networking" tab and click "Ethernet Configuration". Assign port X2 to bridge 2, which CODESYS shows as "br1", to divide the interfaces.
  3. Put the EtherCAT port on a different network segment from the plant network, for example 192.168.1.x on one network and 192.168.2.x on the other as in the reported setup.
  4. Reboot the controller so the new interface state is applied; the change does not take effect without it.
  5. In the EtherCAT master's configuration, set the source adapter to ethX2, the interface that physically reaches the drive on X2, then download and run.

Preparation then completes and the drive appears under the master. Note the order of the report: the separation was tried first, on the older firmware, and failed; the update, the separation and the different network together are the combination that worked.

Separate segments and the subnet arithmetic #

Separation means two interfaces whose network IDs differ. Take a 24-bit mask, 255.255.255.0. Suppose the plant-network port gets 192.168.1.10 and the EtherCAT port gets 192.168.2.20; these are example addresses, so use your site's addressing plan.

  • 192.168.1.10 AND 255.255.255.0 = 192.168.1.0
  • 192.168.2.20 AND 255.255.255.0 = 192.168.2.0

The two results differ, so the ports sit on distinct segments and the runtime routes them as separate interfaces. Had both addresses been inside one of those example ranges, both ANDs would return the same network ID, which is the shared state the reported fix removed. The exact numbers do not matter to the master; what matters is that the two network IDs differ.

The same message on Windows and USB adapters #

Two other reports show the same text with different causes, so match the fix to the target:

  • A Windows runtime, in one report CODESYS Control Win SL 3.5.18.40 with an EK1100 coupler, shows that the adapter could not be opened when the PC's EtherCAT network card has no CODESYS network driver; installing the driver for that one card is the fix there.
  • A Linux runtime with a USB Ethernet adapter plugged in after start does not re-read its adapters; the reported fix was a runtime restart, and a reboot accomplishes the same.

Neither applies to the PFC200: its runtime opens the built-in ports directly, and the missing pieces there were the firmware and the port separation.

PDO access works without the motion license #

With the master running, the drive's inputs and outputs are ordinary PDOs: your logic reads them and writes them with no motion license. The license gate appears one layer up, at adding an axis technology object. The reported project hit exactly that state: EtherCAT communication worked while the axis object stayed unavailable. Experience reported at the time was that the PFC family was not a supported target for that license, with the Edge Controller and TP600 named instead; SoftMotion axis objects on compact Linux runtimes are covered separately in CODESYS SoftMotion over EtherCAT on a Raspberry Pi runtime.

So the decision for a PFC200 torque-mode move is to skip the axis object and drive the servo through its PDOs with the CiA 402 profile.

Decision: torque mode by direct PDO control #

Map the drive's CiA 402 objects in its I/O mapping: the control word (object 6040h) and the target torque (object 6071h) as output PDOs, the status word (object 6041h) as an input. Select torque mode, which is mode of operation 10 in object 6060h if the drive maps it, otherwise in the drive's own mode parameter.

Enable in the standard sequence, 16#0006 shutdown, 16#0007 switch on, then 16#000F enable operation, and command torque as a per-mille of rated torque. Example: 25 % of rated torque is 25 x 1000 / 100 = 250.

An illustrative declaration:

PROGRAM PLC_PRG
VAR
    wControlWord  : UINT := 16#000F;   (* illustrative: enable operation *)
    iTargetTorque : INT  := 250;       (* illustrative: 250 per mille of rated torque *)
    wStatusWord   : UINT;              (* read back from the drive's input PDO *)
END_VAR

Map those three variables to the drive's PDOs in its I/O mapping. The test that proves it: online, step the enable sequence and watch the status word; with bit 3 (fault) clear and bits 1, 2, 4 and 5 set, the drive is in operation enabled and applies the commanded torque.

One safety note: no axis object supervises this move, so the torque limit, travel limits and stop chain must come from the drive's own limits and the hardware safety circuit, not from the logic alone.

Questions asked

Can the second PFC200 port stay on the plant network while EtherCAT runs?

Yes. Keep the engineering and plant network on the first port with its existing address and move only the EtherCAT port to its own segment. That is the point of the separation: the runtime exposes two independent interfaces, so you stay online for programming and diagnostics while the master owns the other port.

Why does the EtherCAT port need an IP address if EtherCAT is not IP traffic?

EtherCAT frames are raw Ethernet frames with ethertype 0x88A4, and the master binds to the interface by its name, not its address. The address places the port on a distinct segment in the runtime's network configuration and lets you reach the controller's diagnostics over that port; the separation itself is what makes the adapter openable.

Does the PFC200 need the CODESYS network driver that Windows targets use?

No. The CODESYS network driver is the Windows step, installed for the network card that carries EtherCAT on a PC runtime. The PFC200 runtime opens its Ethernet interfaces directly, which is why the fix there is firmware 26 plus port separation and a reboot, not a driver installation.

If a motion license is added later, does the port configuration have to be redone?

No. Licensing is independent of the adapter configuration. If the project later runs on a runtime that supports the axis technology object and a license is installed, the EtherCAT master, the separated ports and the PDO mapping stay exactly as they are; only the motion objects are added on top.

Keep reading

  • Selection guide

    How to select a CODESYS fieldbus master for industrial Ethernet

    Select the master around the device, not the connector: the 750-340 is a PROFINET IO coupler, and a PROFIBUS station needs a different coupler. Confirm three matches — device protocol, runtime master package, supported network adapter — then size the bus cycle from the process budget; the worked example clears a 10 ms sensor-to-actuator budget at a 2 ms cycle and fails it at 4 ms. Bench-test a laptop NIC only if the runtime documents it.

    Industrial networks

  • Troubleshooting

    Why online editing slows a DH+ network and how to fix it

    Editing slows because an online edit, every HMI poll and every controller MSG shares one 57.6 kbit/s token-passing DH+ trunk, and the edit bursts are the largest frames on it. Raise the whole segment to 230.4 kbit/s when every node supports it and the trunk is within 2,500 ft; otherwise segment DH+ and bridge through a ControlLogix gateway so editing stops competing with every station.

    Industrial networks

  • Explainer

    Why the PLCnext IO-Link library will not run with a third-party master

    The PLCnext IO-Link library only runs against Phoenix Contact IO-Link master hardware, so no block or setting makes it drive a SICK or ifm master. IEC 61131-9 standardizes the master port to the device, not the fieldbus layout, so each master's own PROFINET cyclic mapping plus its documented acyclic parameter service is the supported route. The library becomes an option only if the project changes to a Phoenix Contact master.

    Industrial networks