# RS485  Modbus RTU

{% hint style="info" %}
RS485 is enabled **only in the Main Screen** state. When the device is in a **settings** or **parameter editing** screen, RS485 will not respond to any Modbus commands.
{% endhint %}

## **Specifications**

| Baud Rate                         | 9600, 19200, 38400, 57600                                                         |
| --------------------------------- | --------------------------------------------------------------------------------- |
| Wiring                            | 2-wire                                                                            |
| Maximum Nodes on the Same Network | 32 (under standard unit load conditions, where each device counts as 1 unit load) |

## RS485 2-Wire Wiring Diagram

* **Black:** RS485 (B−), **Green:** RS485 (A+)

This function operates only when the brown and blue lines of the DC power supply are powered.\
For clarity, the DC power lines are omitted in this diagram. Refer to the **DC Power Wiring Diagram** for details.

{% hint style="danger" %}
Do not confuse RS485 wiring with the power lines; miswiring may damage the device, and repair costs are the user’s responsibility.
{% endhint %}

<div align="left"><figure><img src="/files/y9CJSIhZW30E4W75C1FG" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}

## **Wiring Recommendations**

1. Use **24 AWG shielded twisted pair** for RS485, daisy-chaining each device. Avoid ring or star topologies.
2. For long runs, place **termination resistors (typically 120 Ω)** at the master and far-end device; adjust based on cable specs.
3. If communication is unstable, add **bias resistors** near the master to improve signal stability.
4. For 6-core cables, trim to the minimum required length and connect the shield to ground.
5. In areas with heavy interference, implement **multiple query retries** in software to distinguish signal noise from device offline errors.
   {% endhint %}

### RS485 Modbus RTU Parameter Configuration

Follow the steps below to configure RS485 Modbus RTU parameters:

{% stepper %}
{% step %}

### **Set Basic Parameters**

* Refer to the [**Parameter Settings**](/qr/fp-as310-english-v5/installation-and-setup/parameter-setup.md) page and complete the following steps: **Language Setting, Pipe Settings:A02:** Pipe Standard, **A04:** Pipe Outer Diameter, **A06:** Pipe Wall Thickness, **A08:** Pipe Material
* Execute **Z03 (Automatic Initialization)**.
  {% endstep %}

{% step %}

### **Wiring Setup**

Connect the RS485 Modbus RTU wiring according to the instructions on this page.
{% endstep %}

{% step %}

### **E04 Modbus ID (Communication Protocol Application)**

Set **E04** to assign the flowmeter’s **Modbus Slave ID** on the RS485/Modbus network.

* Ensure that each device on the same bus has a **unique ID** to avoid communication conflicts.
* This parameter **cannot be modified via RS485**.
  {% endstep %}

{% step %}

### **E05 Baud Rate**

Set **E05 Baud** to specify the flowmeter’s **Modbus communication speed** (Baud Rate).

* The **Master** and **Slave** devices must be set to the **same Baud Rate** for proper communication.
* This parameter **cannot be modified via RS485**.
  {% endstep %}

{% step %}

### **Return to Main Screen**

Return to the **Main Screen** (green LED). RS485 communication is enabled **only on the Main Screen**.
{% endstep %}

{% step %}

### Test Read/Write Memory

Refer to the [**Modbus RTU Protocol**](broken://pages/0e501c2c113e328f36c93d4dacf425c434290754) to test the memory for reading and writing.

<table><thead><tr><th width="262.0087890625"></th><th></th></tr></thead><tbody><tr><td><p></p><p>Communication Format</p></td><td><p>bit order: lsb first<br>byte order: big endian<br>Data bits: 8<br>Parity: None<br>Stop bits: 1</p><p>Floating point number follows IEEE754-1985. The float32 below stands for 32bits Single precision floating point number.</p></td></tr><tr><td><strong>Memory Definition and Function</strong></td><td><p>Modbus-accessible memory is divided into <strong>two types</strong>: <strong>Read-Only (RO)</strong> and <strong>Read/Write (RW)</strong>.</p><ol><li><p><strong>Read-Only Memory (RO):</strong></p><ul><li>Primarily stores flowmeter status information, such as real-time flow.</li><li>This type is the most commonly used memory.</li><li>Can <strong>only be read</strong> using function code <strong>04</strong>.</li></ul></li><li><p><strong>Read/Write Memory (RW):</strong></p><ul><li>Primarily stores flowmeter configuration parameters.</li><li><p>Each write operation can <strong>only modify one parameter at a time</strong>.</p><ul><li>If the parameter occupies <strong>1 register</strong>, use function code <strong>06</strong>.</li><li>If the parameter occupies <strong>2 registers</strong>, use function code <strong>30</strong>.</li></ul></li></ul></li></ol></td></tr></tbody></table>

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

### Modbus RTU Example – Reading Float32 Data

Using a Read-Only memory read command (04) as an example, this section explains how to send a command and parse the returned data into a decimal value when the accumulated flow is 20,000.5 liters.

**Read-Only Memory – Read Command (04) Format**

<figure><img src="/files/ulveaqluzw7RJFXl40Ur" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/X4VuslQKI4TA49jNtrNQ" alt=""><figcaption></figcaption></figure>

#### **Modbus RTU Example – Read-Only Memory Read Command (04)**

**Master Sends Read Command (TX Frame)**

According to device specifications, the accumulated flow is stored in **Float32 format**, occupying **2 registers (4 bytes)**; therefore, the quantity to read should be set to **00 02**. The master must send Modbus function code 04 (Read Input Registers) to read 2 registers starting from address 0000.

```
TX: 01 04 00 00 00 02 71 CB
```

* Slave Address = 01
* Function Code = 04
* Starting Register Address = 00 00
* Quantity to Read = 00 02 (2 registers)
* CRC Checksum = 71 CB

**Slave Response Data (RX Frame)**

After receiving the read request, the slave returns the internally stored **20,000.5 liters (Float32)** data, packaged as **4 bytes** according to **Modbus Register Big Endian** (high byte first) and **IEEE 754 Float32** format.

```
RX: 01 04 04 45 9C 40 00 E2 56
```

* Slave Address = 01
* Function Code = 04
* Byte Count (Number of Data Bytes) = 04 (4 Bytes)
* Data (Data Field) = 45 9C 40 00
* CRC Checksum = E2 56

**Data Parsing and Conversion (Back to Decimal)**

**Step A: Arrange the Data**\
Since the device uses **Big Endian** format, the most significant byte comes first. Therefore, the 4 bytes are kept in the received order and combined as:\
`459C4000₁₆`

**Step B: Decode the Float32 Structure (SEM: S = Sign, E = Exponent, M = Mantissa)**\
Convert `459C4000₁₆` into a 32-bit binary number for IEEE 754 Float32 interpretation.

![](/spaces/i4ECt41Kyy9211OWazj4/files/cf1a08ca8450871ffcb0418bcad5094b528d9cd8)

**Partial Binary Value Explanation**

* **S (Sign bit)** = 0 (1 bit) → 0 means a positive number
* **E (Exponent bits)** = `10001011` (8 bits) → 139₁₀\
  Actual exponent = 139 − 127 = **12**
* **M (Mantissa bits)** = `001110001...` (23 bits) → the significand is **1.M**

**Step C: Calculate the Value**

According to the IEEE 754 Float32 format, the calculation is as follows.\
The exponent bits `10001011₂` equal 139₁₀, so the actual exponent is 139 − 127 = 12.

* The mantissa bits are 0011100100000000000000，, giving a significand of 1.001110001...

After shifting the binary point 12 places to the right and converting to decimal:

Value = 2¹⁴ + 2¹¹ + 2¹⁰ + 2⁹ + 2⁵ + 2⁻¹\
\= 16384 + 2048 + 1024 + 512 + 32 + 0.5\
\= 20000.5

Therefore, the Modbus RX response data `01 04 04 45 9C 40 00 E2 56` represents a cumulative flow value of **20000.5 liters**.

### **Modbus Data Format Converter**

Below is a sample **HTML/CSS/JS (CodePen example)** of a simple converter used to convert an **8-digit hexadecimal value** into a **Float32** number.

{% embed url="<https://codepen.io/philo_lorric/pen/BagqoRj>" %}

{% hint style="info" %}
RS485 will not respond in the setup screen.
{% endhint %}

## **SPEC**

Please see the page of [monitoring screen.](broken://pages/-M7fhYXcoDnvPdmAaK7R#monitoring-screen-detail)

## **Cable** wiring

Please see the page of [mechanical and electrical installation.](broken://pages/-M7fcZ3Jd6P4CmQ3t66Y)

## **Parameter setup**

Please refer to [parameter set-up page](broken://pages/-M7fkDLSPTCpFlYKYv4S).

Set-up steps as below:

1. Please set up the [basic parameters](broken://pages/-M7fcYXR1ZAz9KgwGX8l) first.
2. Connect cable according to the cable wiring instructions on this page.
3. This machine uses Modbus RTU protocol, communication parameter set-up as below.：
   1. Set E04 for Modbus ID , and please make sure there is no other device using the same address.
   2. Set E05 for specifying communication Baud, this machine supports 9600, 19200, 38400.
4. Please go back to the monitoring screen. RS485 only responses on monitoring screens.
5. If needed, please use F01 and F02 to set up the machine to do communication test under simulation mode.
6. Please refer to the [Modbus RTU protocol page](broken://pages/-M7fjvNw-NvqF7DOUr-o) for testing the memory with read and write instruction.
7. Turn off F02 simulation mode.
8. Finish.

### [E15 Byte format](/qr/fp-as310-english-v5/parameters.md#e-tong-xun-can-shu-lie-biao)

This setting provides 4 options.

| Option name | Full name                       |
| ----------- | ------------------------------- |
| N.8.1       | No parity bit with 1 stop bit   |
| N.8.2       | No parity bit with 2 stop bits  |
| O.8.1       | Odd parity bit with 1 stop bit. |
| E.8.1       | Even parity bit with 1 stop bit |

ST stands for start bit, D0 \~ D7 are data bits, SP stands for stop bit.

OP and EP stands for Odd-parity and Even-parity respectively

<figure><img src="/files/CjwmnowwAsdF0wR2FoqP" alt=""><figcaption></figcaption></figure>

### [E16 Bit order](/qr/fp-as310-english-v5/parameters.md#e-tong-xun-can-shu-lie-biao)

This option controls the direction of the transfer and selects LSB or MSB first.

LSB first is typically used for Modbus RTU.

The figure below presents the difference with N-8-1 mode.

<figure><img src="/files/yF2eMat0vFINPikVXRYY" alt=""><figcaption></figcaption></figure>

### [E17 Endianness](/qr/fp-as310-english-v5/parameters.md#e-tong-xun-can-shu-lie-biao)

This setting controls the byte order of multi-byte data. This setting solely interacts with the byte order of replied data. The byte format of register address and length in the commands still conform to the examples provided by manual. The figure below presents the byte order for when converting number 1000 in IEEE-754 format.

<figure><img src="/files/g2KzrikpVdUoIaIEkoHl" alt=""><figcaption></figcaption></figure>

### **Example**

The command below requests instantaneous flow speed (abbreviated to FS) and totalized flow rate ( abbreviated to TF) from the device.

<figure><img src="/files/FlAI6YF5LrtFVrCyOQFH" alt=""><figcaption></figcaption></figure>

According to the Modbus protocol, the address and length of registers both consist of two bytes. And as the figure above shows, this option does not affect the byte order of the command. It only changes the order of replied data.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lorric.com/qr/fp-as310-english-v5/communication/rs485-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
