ModBus RTU

Modbus RTU (Remote Terminal Unit) is a communication protocol used for sending information between electronic devices via serial communication. It is one of the most widely used protocols in industrial automation and is often used to communicate with programmable logic controllers (PLCs), sensors, actuators and other devices in automated systems.

Here are some key features and concepts related to Modbus RTU:

Serial Communication: Modbus RTU uses serial communication, which means that data bits are transmitted sequentially over a single wire. The protocol supports both RS-232 and RS-485 communication.

Master-Slave Architecture: In a Modbus RTU network, there is usually a master device that initiates communication and one or more slave devices that respond to the master's instructions. The master sends requests to the slaves to read or write data.

Registers: Modbus RTU works with "registers" that contain specific data. There are two types of registers: Input Registers and Holding Registers. Input Registers contain data that is read-only to the master, while Holding Registers contain data that is readable and writeable.

Addressing: Each device in a Modbus RTU network has a unique address, which is used to determine which device should respond to a particular request. Addresses typically range from 1 to 247.

Data format: Modbus RTU uses a binary format to transmit data. Each transmission starts with a "slave address" and a "function code" indicating which device is being addressed and which operation is to be performed (read or write).

CRC (Cyclic Redundancy Check): To ensure communication reliability, Modbus RTU adds a CRC checksum to each message. The CRC is calculated based on the content of the message and is used to detect any errors in the transmission.

Baud rate and Parity: When setting up a Modbus RTU connection, the baud rate (speed of data transmission) and parity (an error detection method) must be configured on both master and slave devices.