Overview

TwinCAT 3 Modbus RTU offers function blocks for serial communication with Modbus terminal devices.

Overview 1:

Modbus RTU devices are connected to a Beckhoff Controller via a serial interface. The TwinCAT PLC uses slave function blocks of the Modbus RTU library for communication with my Modbus master (slave mode). In addition, master function blocks are available for addressing several Modbus slaves (master mode)

Supported interfaces

Further documentation

Technical details and specification about Modbus can be found under: http://www.modbus.org


Boundary conditions

The Modbus protocol defines accurate timing to ensure, for example, the complete transfer of all characters of a telegram. Since the communication Modbus RTU is realized on a PLC controller, accurate timing cannot be guaranteed due to the cyclic execution of the PLC program. Most end devices are very tolerant and function without problems in the event of short time gaps between characters. In individual cases, the behavior of the end device should be checked.

The second channel of an EL60x2 is not suitable for Modbus RTU communication, because it is processed with low priority, which means the frames are sent with gaps, which in turn could be detected by the remote terminal as frame errors.

Overview 2:

With some serial interface terminals an internal buffer can be filled before sending (option continuous sending). The ModbusRTU library can use this feature if it is set in the corresponding serial terminal. For example, on the KL6031 continuous mode can be activated with the KL6configuration configuration function block (register 34 bit 6). Up to 128 bytes are then placed in the internal buffer of the Bus Terminal and transmitted continuously.