Learn PLCs free
Beckhoff Implementation

Modbus RTU for Beckhoff

Serial communication protocol using binary encoding over RS-232/RS-485. Most widely used industrial protocol worldwide.

Type: Serial CommunicationSpeed: Up to 115.2 kbpsReleased: 1979Organization: Modbus Organization
115.2 kbps max
Bandwidth
247
Max Nodes
1200m (RS-485)
Max Distance
Yes
Real-Time

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/COM2

Wiring 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_MBWriteRegs
FB_MBReadCoils
FB_MBWriteCoils
FB_ModbusRTUMasterV2 (with queue)
FB_ModbusRTUSlave

Beckhoff 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

Simple sensor and actuator networks
Building automation
Energy management systems
Water/wastewater treatment
Legacy equipment integration
Small to medium manufacturing lines

Industry Adoption

Adoption LevelVery High
Market Share30-40% of industrial protocols
Geographic PresenceWorldwide
Primary Industries
ManufacturingBuilding AutomationEnergyWater Treatment

Supported Message Types

Read Coils
Read Discrete Inputs
Read Holding Registers
Write Single Coil
Write Single Register
Write Multiple Registers

Free PLC simulator

Stop reading, start doing

Write ladder logic in your browser, hit Run, and watch real machine scenarios react. 12 guided lessons across 8 PLC dialects — free account, no credit card.

Practice PLCs free →