CODESYS Platform · 04
Fieldbus and communication: one project from the field to the layer above
The fieldbus is set up in the configurator and the protocols that carry data upstream live in the same project. No separate gateway or converter software is required.
Supported stacks
Which protocol is right depends on what the machine needs — you do not have to run them all. Here is what the ones we use most often are for.
- EtherCAT The first choice for synchronised axis control. A single telegram passes through every device on the line, and the distributed clock updates all axes at the same instant.
- PROFINET For fitting in with an existing device population where the plant infrastructure is already widespread.
- EtherNet/IP On lines that include equipment of North American origin.
- CANopen On machines with a limited number of drives and sensors but long cable runs.
- Modbus TCP / RTU A practical bridge where legacy equipment has to join the line.
- OPC UA Exposing production data in a standard form to the manufacturing execution, supervision or reporting layer.
What decides synchronisation is the clock, not the speed
What makes EtherCAT fast is not the cable but the way the frame is processed. On a multi-axis line, though, the result is decided far less by bandwidth than by clock alignment. Once the devices on the network are aligned to a common reference clock, the gap between one axis updating its position and the next drops to nanoseconds.
In synchronised cutting, cam following and multi-axis interpolation, this is usually where the error should be looked for first.
How we commission a network
A network that “works” and a network that “works reliably” are two different things. The devices appear, data flows, the axes turn — but when the cycle time occasionally slips, you notice it in the product dimensions, not on the screen.
- Topology verification Device order, cable lengths and junction points are checked against the drawing.
- Reference clock selection The clock is assigned to the most stable device and all axes are put in the same mode.
- Frame counters Lost and re-sent frames are monitored; a rising trend is the earliest sign of a cable or connector problem.
- Measurement under load The network is measured with every axis moving, not idle. Figures from an idle network do not represent the field.
For the timing foundations see Control Runtime, and for the axis side SoftMotion .
Frequently asked questions about fieldbus
Do I need a special network card for EtherCAT?
In the real-time edition the network card is driven directly, so it must use a supported chipset. Most office cards will work, but their latency is not stable enough; confirming the card model before commissioning saves time.
Line topology or star?
EtherCAT works as a line by nature: each device processes the data and passes it on. Where branching is needed, junction modules are used. Unnecessary branches added just to shorten cable runs make fault isolation harder, so we generally avoid them.
Can I use devices from different manufacturers on one network?
Yes. Once the manufacturer’s device description file is added to the project, the module appears in the configurator and its object dictionary opens. On a mixed network the one thing to watch is that the synchronisation mode is chosen consistently across all devices.
What data can I expose over OPC UA?
Whatever subset of your application variables you choose. The right approach is not to expose everything but to define the data model the upper layer actually needs — production counters, status, alarm history and recipe identifiers cover most plants.
Should the machine network be connected to the corporate network?
Not directly. The machine network should stay in its own segment, with data exchange going through a single controlled point. Leaving a machine exposed to the internet is a risk to both safety and production continuity, so we plan the segmentation at the start of the project.
What is the cable length limit?
A hundred metres between two devices is the practical limit on copper; beyond that we use fibre junctions. On long runs the real issue is not distance but sources of interference in the cable tray. Data cables routed alongside power cables are a frequent cause of the faults we see in the field.
What happens if the network drops?
The runtime detects the loss on the line and the error behaviour defined in the application takes over, bringing the drives to a controlled stop. How that behaves is specified at the start of the project, never improvised later. Stops with a safety requirement remain the responsibility of the separate safety chain.
Do I have to keep our existing PROFINET infrastructure?
No, but it often makes sense. If the plant has a large installed base and a spare-parts stock, staying on the same protocol lowers operating cost. Where a new machine needs synchronised axes, putting the motion side on EtherCAT while keeping the plant connection on PROFINET is a common answer.
How do you diagnose network problems?
Starting from the frame counters. A rising trend in lost and re-sent frames is the earliest indicator of a cable or connector problem, and it usually appears before anything shows up in product dimensions. We take the measurement with all axes moving, never on an idle network.
Can I bring old Modbus devices onto the line?
Yes — Modbus TCP or RTU makes a practical bridge. What matters is accepting that these devices are slow and binding them to a separate slow task rather than the fast motion task. Otherwise one legacy device will hold up the entire cycle.