Modbus RTU for Beckhoff
Serial communication protocol using binary encoding over RS-232/RS-485. Most widely used industrial protocol worldwide.
Protocol Overview
Beckhoff TwinCAT 3 implements Modbus RTU via EL6xxx EtherCAT serial terminals or embedded PC COM ports. Tc2_ModbusRTU library provides comprehensive master/slave function blocks.
When to Use Modbus RTU
Choose Modbus RTU for simple applications, legacy integrations, cost-sensitive projects, or when connecting basic I/O devices over short to medium distances.
Beckhoff Hardware Requirements
Compatible Communication Modules
EL6021 (1x RS-232)EL6022 (2x RS-232)EL6001 (1x RS-232/RS-485 switchable)KL6021 (BUS Terminal RS-232)KL6041 (BUS Terminal RS-485)CX Embedded PC COM1/COM2Wiring Details
EL6001 RS-485: Pin 3 (TxD+/A), Pin 6 (TxD-/B), Pin 9 (GND). DIP SW1=ON for RS-485 mode.
Termination
EL6001 built-in 120Ω termination. DIP SW2=ON enables, SW2=OFF disables. Enable at bus ends only.
Beckhoff Software & Programming
Function Blocks & Instructions
FB_MBReadRegs (Tc2_ModbusRTU)FB_MBWriteRegsFB_MBReadCoilsFB_MBWriteCoilsFB_ModbusRTUMasterV2 (with queue)FB_ModbusRTUSlaveBeckhoff Code Example
fbModbusRead( UnitID := 1, Quantity := 10, MBAddr := 0, // 0-indexed cbLength := SIZEOF(arrReadData), pDestAddr := ADR(arrReadData), Execute := TRUE, => Busy => bBusy, => Error => bError, => ErrorId => nErrID );
Beckhoff-Specific Implementation Notes
EL6xxx terminals have independent mailbox communication via CoE (CANopen over EtherCAT). Configure baudrate via CoE index 0x8000:01. Use FB_ModbusRTUMasterV2 for request queuing. Supports byte swapping functions for endianness conversion.
Technical Specifications
Physical Layer
- Physical Layer: RS-232, RS-422, RS-485
- Cable Type: RS-485 twisted pair, RS-232
- Topology: Bus, Star, Tree
- Power Over Cable: No
Data Layer
- Data Link: Master/Slave
- Encoding: Binary (RTU mode)
- Error Detection: CRC-16
- Frame Size: 256 bytes max
Performance
- Scan Time: 10-100ms typical
- Deterministic: Yes
- Real-Time: Yes
Certification
- Certification Required: No
- License Cost: Free (open standard)
- Version: Current
Advantages & Disadvantages
Advantages
- ✓Simple and easy to implement
- ✓Very low cost
- ✓Excellent industry support
- ✓Reliable in harsh environments
- ✓Minimal hardware requirements
- ✓Open standard
- ✓Wide device compatibility
Disadvantages
- ✗Limited speed (115.2 kbps max)
- ✗No built-in security
- ✗Master/slave only (no peer-to-peer)
- ✗Limited diagnostic capabilities
- ✗No standardized device profiles
- ✗Requires proper termination
Common Use Cases & Applications
Industry Adoption
Supported Message Types
Read CoilsRead Discrete InputsRead Holding RegistersWrite Single CoilWrite Single RegisterWrite Multiple RegistersSupported PLC Brands
Alternative Protocols
Related Standards
- IEC 61131-3
International standard for programmable logic controller programming languages. Defines 5 programmin...
- IEC 61131 Series
Complete series of international standards for programmable logic controllers covering hardware, sof...
Related Protocols
- PROFIBUS
Process Field Bus - established fieldbus standard for factory and process automa...
Fieldbus • 9.6 kbps to 12 Mbps - DeviceNet
CAN-based fieldbus protocol for industrial automation. Part of the CIP family wi...
Fieldbus • 125, 250, or 500 kbps - CAN Bus
Controller Area Network - robust vehicle bus standard for microcontrollers and d...
Serial Communication • Up to 1 Mbps (CAN 2.0), 8 Mbps (CAN FD) - Modbus TCP/IP
Ethernet-based variant of Modbus using TCP/IP. Combines simplicity of Modbus wit...
Industrial Ethernet • 10/100/1000 Mbps - ControlNet
Deterministic network protocol for real-time control applications. Part of CIP f...
Fieldbus • 5 Mbps - CC-Link
Control and Communication Link - open fieldbus network by Mitsubishi Electric, d...
Fieldbus • 156 kbps to 10 Mbps (fieldbus), 1 Gbps (IE)