# Modbus RTU Protocol

### Communication Format

| Name                    |           Value | Description                                                              |
| ----------------------- | --------------: | ------------------------------------------------------------------------ |
| Bit Order               |       lsb first | Data is transmitted starting from the Least Significant Bit (LSB).       |
| Byte Order              |      big endian | Data is transmitted starting from the Most Significant Byte (MSB).       |
| Data bits               |               8 | Each character or byte consists of 8 data bits.                          |
| Parity                  |            None | No parity bit is used for error checking during transmission.            |
| Stop bits               |               1 | 1 stop bit is used at the end of each character.                         |
| Floating-Point Standard |   IEEE 754-1985 | Floating-point numbers (Float32) use the 32-bit single-precision format. |
| Register                | 2 Byte / 16 bit | Floating-point numbers (Float32) use the 32-bit single-precision format. |
| Byte                    |           8 bit | The basic unit length of data transmission.                              |

{% hint style="info" %}
In **Modbus RTU communication**, a **Register** is the basic unit of memory communication, with a length of **2 bytes (16 bits)**. A **Byte** is the basic unit of data transmission, with a length of **8 bits**.
{% endhint %}

***

### **Memory Definition and Functions**

| Memory Types   | Read-Only Memory                                                                         | Read/Write Memory                                                                                                                    |
| -------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| Main Functions | Read the device’s real-time status and results.                                          | Set the device’s operating parameters and calibration values.                                                                        |
| Stored Content | Stores memory related to **flow status**, such as instantaneous flow and totalized flow. | Stores memory related to **flow configuration parameters**, such as pipe diameter, calibration coefficients, and flow cutoff values. |
| Access Rights  | **Read-only**: can only be read, not written.                                            | **Read/Write**: can be both read and written.                                                                                        |
| Function Codes | **Read Command**: 04 (Read Input Registers)                                              | **Read Command**: 03; **Write Command**: 06 / 30 / 31                                                                                |
