Industrial networks: Modbus, Profibus, EtherCAT
Industrial networks: RS-485, Modbus RTU/TCP data model and frames, Profibus DP/PA, and EtherCAT processing on the fly and distributed clocks, with Modbus timing, efficiency and EtherCAT cycle-time estimates.
Drafted with Aria, reviewed by the AiCanCode.org team. Spotted an error? Use Give Feedback at the bottom of the page.
Why it matters
Instead of running a pair of wires from every sensor to the control cabinet, modern machines connect drives, remote I/O, meters and HMIs over industrial networks. The network decides how fast and how deterministically data moves — a motion system with 50 synchronised servo axes needs a very different bus from a set of energy meters. Modbus, Profibus and EtherCAT represent the three generations engineers meet most: simple serial, classic fieldbus and real-time Ethernet.
Key ideas
Why industrial networks differ from office networks. They must be deterministic (bounded, repeatable update times), robust against electrical noise, simple to diagnose, and often must work in hazardous areas. Typical requirements: process I/O 10–100 ms, machine I/O 1–10 ms, motion control ≤ 1 ms with sub-microsecond synchronisation.
Physical layer: RS-485. Differential two-wire, multi-drop, up to 32 unit loads per segment (more with repeaters or fractional-load transceivers), about 1200 m at low bit rates. A daisy-chain (line) topology with a 120 Ω termination resistor at each end of the cable (Profibus uses its own active termination) prevents reflections.
Modbus (1979, open).
- Client/server (traditionally master/slave): only the master starts a transaction; slaves answer. Up to 247 slave addresses on a serial line.
- Data model: coils (read/write bits), discrete inputs (read-only bits), input registers (read-only 16-bit words), holding registers (read/write 16-bit words).
- Common function codes: 01 read coils, 02 read discrete inputs, 03 read holding registers, 04 read input registers, 05 write single coil, 06 write single register, 15 write multiple coils, 16 write multiple registers. An exception response returns the function code + 0x80.
- Modbus RTU: binary frame = slave address (1 byte) + function code (1) + data + CRC-16 (2). Frames are separated by at least 3.5 character times of silence. The standard character is 11 bits (start, 8 data, parity, stop — or two stops without parity).
- Modbus ASCII: hex characters with LRC check; slower, rarely used now.
- Modbus TCP: the same PDU inside TCP/IP (port 502) with a 7-byte MBAP header instead of address and CRC (Ethernet/TCP provide addressing and error checking).
- Strengths: simple, open, universal. Limits: polling only, no built-in data types beyond bits and 16-bit words, no security, modest speed.
Profibus (Process Field Bus, IEC 61158/61784).
- Profibus DP (Decentralised Peripherals): RS-485 at 9.6 kbit/s up to 12 Mbit/s, the higher rates over shorter cables. Up to 126 addresses (0–125), 32 stations per segment.
- Media access: token passing between masters plus master–slave polling of each master's slaves, so the cycle is deterministic. Class 1 masters (PLCs) exchange cyclic I/O; class 2 masters (engineering tools) do configuration and diagnostics.
- Device description (GSD) files tell the configuration tool what each slave offers; rich per-station diagnostics.
- Profibus PA (Process Automation): MBP physical layer at 31.25 kbit/s, two wires carrying both power and data, intrinsically safe for hazardous areas; connected to DP through a coupler.
- Its Ethernet successor is PROFINET.
EtherCAT (Beckhoff, now IEC 61158, ETG).
- Standard 100 Mbit/s Ethernet frames, but slaves use a hardware EtherCAT slave controller.
- Processing on the fly: one frame from the master passes through every slave; each slave reads its outputs and inserts its inputs as the frame streams through, delaying it only by a fraction of a microsecond. The last slave sends the frame back (full-duplex makes a logical ring), so one frame serves the whole network every cycle.
- Very high bandwidth utilisation, cycle times of 100 µs or less for many axes, and distributed clocks that synchronise slaves to well under 1 µs — ideal for multi-axis motion (CoE: CANopen over EtherCAT drive profiles).
- Flexible topology (line, tree, star); the master needs only a standard Ethernet port.
Choosing. Modbus for simple data exchange with meters, drives and third-party devices; Profibus DP/PA where it is the plant standard, especially process plants; EtherCAT (or PROFINET IRT, Sercos III) for fast synchronised motion; OPC UA above them for plant-wide, secure information exchange.
Formulas
t_char = n_bits / baud
- Character time (s); n_bits = 11 for standard Modbus RTU characters (10 for the common 8N1 deviation).
t_frame = n_bytes × t_char
t_gap = 3.5 × t_char
- Minimum Modbus RTU inter-frame silence (s) (fixed at 1.75 ms above 19 200 baud).
Request (read N registers) = 8 bytes; Response = 5 + 2N bytes
- Modbus RTU frame sizes, including address, function, byte count and CRC.
Byte rate = baud / n_bits
- Maximum characters per second on a serial line.
η = useful bytes / total bytes
- Protocol efficiency.
t_cycle,ECAT ≈ (n_frame × 8) / 100 Mbit/s + N_slaves × t_fwd
- EtherCAT cycle estimate (s): frame bits on the wire plus the forwarding delay t_fwd per slave (take from the slave datasheet).
Worked examples
Example 1 (standard). A Modbus RTU master at 19 200 baud, 11-bit characters, reads 50 holding registers from one slave. Find the frame sizes, total transmission time (with two inter-frame gaps) and the efficiency. Compare the efficiency of reading 1 register.
t_char = 11 / 19 200 = 0.573 ms.- Request = 8 bytes; response = 5 + 2 × 50 = 105 bytes; total = 113 bytes.
t_frames = 113 × 0.573 = 64.7 ms; gaps = 2 × 3.5 × 0.573 = 4.0 ms → total ≈ 68.8 ms.- Useful data = 100 bytes → η = 100 / 113 = 88.5 %.
- One register: useful 2 bytes out of 8 + 7 = 15 → η = 13.3 %.
Answer: ≈ 68.8 ms per transaction; efficiency 88.5 % for 50 registers vs 13.3 % for one — read registers in blocks.
Example 2 (GATE level). A packaging machine has 100 EtherCAT servo drives, each exchanging 8 bytes of process data per cycle, in one frame with about 54 bytes of Ethernet/EtherCAT overhead (preamble, headers, checksum, inter-frame gap). Assume a forwarding delay of 1 µs per slave. (a) Estimate the cycle time. (b) Could Profibus DP at 12 Mbit/s cover a 250 m line?
- Frame size = 100 × 8 + 54 = 854 bytes = 6832 bits.
- Wire time = 6832 / 100 × 10⁶ = 68.3 µs.
- Forwarding = 100 × 1 µs = 100 µs.
t_cycle ≈ 68.3 + 100 = 168 µs→ a 250 µs cycle is easily achievable.- Profibus DP at 12 Mbit/s is limited to about 100 m per segment (1.5 Mbit/s allows about 200 m, 500 kbit/s about 400 m), so 250 m needs a lower rate or repeaters.
Answers: ≈ 0.17 ms EtherCAT cycle; Profibus at 12 Mbit/s cannot span 250 m without repeaters.
Common mistakes
- Assuming 10 bits per character for Modbus RTU when the device uses parity (11 bits).
- Off-by-one register addressing: "40001" in documentation is register offset 0 in the frame.
- Forgetting termination at both ends of an RS-485/Profibus line, or using star wiring.
- Expecting slaves to send data on their own on Modbus — only the master initiates.
- Thinking EtherCAT is ordinary switched Ethernet — slaves need EtherCAT hardware.
- Running Profibus DP at 12 Mbit/s over long cables.
- Mixing up Profibus DP (factory, fast) and PA (process, powered, intrinsically safe).
For GATE ME
Industrial networks produce MCQs on protocol features (master/slave, token passing, processing on the fly, physical layers, topologies, typical uses) and simple numericals on character time, frame time, transfer time, byte rate and efficiency. Practise counting bits per character correctly and adding protocol overhead before computing times.
Quick check
- Which Modbus function code reads holding registers?
- How many bytes are in a Modbus RTU response to a request for 10 registers?
- What does "processing on the fly" mean in EtherCAT?
- How many characters per second can a 9600-baud line carry at 10 bits per character?
- What is the bit rate of Profibus PA?
Answers: 1. 03 2. 25 3. Each slave reads and writes its data while the frame passes through it, without storing the whole frame 4. 960 5. 31.25 kbit/s
Interview questions
All Microcontrollers, PLC and Industrial Automation interview questionsTry answering each one aloud before you open it.
1.What is Modbus and where is it commonly used?Concept
Modbus is a communication protocol developed for industrial applications to facilitate communication between devices. It is commonly used in Supervisory Control and Data Acquisition (SCADA) systems and Programmable Logic Controllers (PLCs) for monitoring and controlling industrial equipment.
2.Explain the difference between Profibus and EtherCAT.Concept
Profibus is a fieldbus communication standard used for automation technology, which allows communication between devices on a network. EtherCAT, on the other hand, is an Ethernet-based fieldbus system known for its high-speed communication and efficiency. While Profibus is widely used in traditional automation systems, EtherCAT is preferred in applications requiring real-time data exchange and high-speed performance.
3.How does Modbus RTU differ from Modbus TCP?Concept
Modbus RTU (Remote Terminal Unit) is a serial communication protocol that uses binary encoding and is typically used over RS-485 or RS-232. Modbus TCP, however, is an Ethernet-based protocol that uses TCP/IP for communication. The main difference lies in their transport layers: Modbus RTU is used for serial communication, while Modbus TCP is used for network communication over Ethernet.
4.Why is EtherCAT preferred in applications requiring real-time data exchange?Application
EtherCAT is preferred in real-time applications because it uses a unique 'processing on the fly' method, which allows data to be processed as it passes through each node. This reduces latency and increases the speed of data exchange, making it ideal for applications that require precise timing and synchronization.
5.What happens if a device on a Profibus network fails?Application
If a slave stops responding, the master marks it as missing in its diagnostics, typically raises a station-failure alarm in the PLC, and keeps polling the remaining slaves, so the rest of the network continues; the PLC program decides how the machine reacts to losing that station's I/O. A physical fault such as a cable break, short or missing termination is worse because it can disturb the whole segment. Redundant masters or cables exist for critical plants, but are an option rather than standard.
6.In what scenarios would you choose Modbus over other industrial communication protocols?Application
Modbus is often chosen for its simplicity, ease of implementation, and wide acceptance in the industry. It is suitable for applications where the communication speed is not critical, and the network size is relatively small. Modbus is also preferred when integrating devices from different manufacturers, as it is an open protocol with broad compatibility.
7.Calculate the data transfer rate of a Modbus RTU network operating at 9600 baud with 8 data bits, no parity, and 1 stop bit.Numerical
The data transfer rate can be calculated using the formula: Data Transfer Rate = Baud Rate / (1 + Number of Data Bits + Parity Bit + Stop Bit). For this configuration: Data Transfer Rate = 9600 / (1 + 8 + 0 + 1) = 9600 / 10 = 960 bytes per second.
8.How does the cyclic redundancy check (CRC) work in Modbus communication?Concept
In Modbus communication, the cyclic redundancy check (CRC) is used to detect errors in transmitted messages. It involves appending a CRC value to the message, which is calculated based on the message content. The receiving device recalculates the CRC from the received message and compares it with the transmitted CRC. If they match, the message is considered error-free; otherwise, an error is detected.
9.What are the advantages of using Profibus in industrial automation?Application
Profibus offers several advantages in industrial automation, including high reliability, real-time communication capabilities, and support for a wide range of devices and applications. It also provides diagnostic features that help in troubleshooting and maintaining the network. Additionally, Profibus supports both discrete and process automation, making it versatile for various industrial environments.
10.If an EtherCAT network has a cycle time of 1 ms, how many cycles occur in one minute?Numerical
To find the number of cycles in one minute, divide the total time in milliseconds by the cycle time: Number of Cycles = (60 seconds * 1000 ms/second) / 1 ms = 60,000 cycles.
Finished this topic? Mark it so your progress, study plan and readiness keep up.
Stuck on something here?