> For the complete documentation index, see [llms.txt](https://docs.lorric.com/qr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lorric.com/qr/fu-tx320-english-v1/communication/modbus-rtu-protocol/read-write-memory-ram/read-write-memory-dual-register-write-command-30.md).

# Read/Write Memory Dual-Register Write Command (30)

{% hint style="info" %}
When large values are processed using different data formats (e.g., *float32* vs. *int32*), minor numerical differences may occur due to internal calculation methods. These differences are typically less than **1/10,000** and are normal.

This command applies **only to 32-bit (2-register) memory items**, and uses a **fixed 10-byte frame** — it does not include a Quantity of Registers or Byte Count field, since the length is always exactly 2 registers.
{% endhint %}

#### Function Code 30

The Dual Register Write command (Function Code 30) writes data to two consecutive registers (32-bit / 4 bytes) using a short, fixed-length frame.\
It is used for parameters that include decimal or signed values.\
Float32 range: \~1.18 × 10⁻³⁸ to 3.4 × 10³⁸\
Examples: Set A18 Low Flow Cutoff to +5.5, or K03 Scale Factor to 1.25.

#### Read/Write Memory – Dual Register Write Command (30) Format

![](https://2757023840-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfX3l9RzQpCUpspFteU5B%2Fuploads%2FYTqwHG2PBRW4JyatueiI%2Fmodbus-30-TX-diagram-en.png?alt=media\&token=e45a35f9-cb7b-48ff-ad54-50a49cd8ff00)

Function Code 30 uses a mirror-response mechanism. When the write is successful, the **RX response frame** from the slave will exactly match the TX request in both format and content.

***

## Modbus RTU Read/Write Memory – Dual Register Write Command (Function Code 30)

### **Example 1 — A18 Low Flow Cutoff:**

This example shows the master using **Function Code 30** to write **+5.5** to the parameter **“A18 Low Flow Cutoff”**.

According to the Read/Write Memory List:

* **Starting Address:** 00 15
* **Register Length:** 2 (two registers)
* **Data Type:** Float 32

#### 1. Value Conversion and Data Preparation (Hex Data)

Convert the decimal value **+5.5** to **IEEE 754 Float32 (Big Endian)** format.

$$
5.5 ₁₀ = 40B00000 ₁₆
$$

The resulting 4-byte data is:：`40` `B0` `00` `00`。

#### 2. Master Sends Write Command (TX Frame)

The master uses Function Code 30 with a Byte Count of 04, writing 4 data bytes to two registers starting at address 00 15.

```
TX： 01 30 00 15 40 B0 00 00 A8 20
```

* Slave Address: `01`
* Function Code: `30`
* Starting Register Address: `00 15` (A18 Low Flow Cutoff)
* Number of Registers Written: `00 02` (2 registers / Float32)
* Byte Count: `04` (4 data bytes)
* Written Data (Float32): `40 B0 00 00` (+5.5 in Hex)
* CRC: `27 D1` (calculated CRC)

#### 3. **Slave Response (RX Frame)**

When the write command is successful, the master receives a response from the slave as confirmation.

```
RX: 01 30 00 15 40 B0 00 00 A8 20
```

* Slave Address: `01`
* Function Code: `30`
* Starting Register Address: `00 15` (A18 Low Flow Cutoff)
* Registers Written: `00 02` (confirmation of 2 registers written)
* CRC: `D1 CB` (calculated CRC)

Once the master receives the RX frame and verifies that the **Function Code**, **register address**, and **number of registers written** are correct, it confirms that **A18 Low Flow Cutoff has been successfully set to +5.5**.

***

### **Example 2 — A18 Low Flow Cutoff:**

This example shows the master using **Function Code 30** to write **1.25** to the parameter **"K03 Scale Factor"**.

According to the Read/Write Memory List:

* Starting Address: 0A 01
* Register Length: 2 (two registers)
* Data Type: Float 32

#### **1. Value Conversion and Data Preparation (Hex Data)**

Convert the decimal value 1.25 to IEEE 754 Float32 (Big Endian) format.

The resulting 4-byte data is: `3F A0 00 00`.

#### **2. Master Sends Write Command (TX Frame)**

```
TX: 01 30 0A 01 3F A0 00 00 80 98
```

* Slave Address: 01
* Function Code: 30
* Starting Register Address: 0A 01 (K03 Scale Factor)
* Write Data (Float32): 3F A0 00 00 (1.25 in Hex)
* CRC: 80 98 (calculated CRC)

#### **3. Slave Response (RX Frame)**

```
RX: 01 30 0A 01 3F A0 00 00 80 98
```

Mirrors the TX frame exactly, confirming the write succeeded.

**Write Failure — Exception Response**

If the write fails (e.g., the value is outside the parameter's valid range), the slave returns a 5-byte exception frame instead of an echo:

Slave Address | Function Code | 0x80 | Exception Code | CRC (2 bytes)

Example: exception code `0x03` indicates the value is out of range.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.lorric.com/qr/fu-tx320-english-v1/communication/modbus-rtu-protocol/read-write-memory-ram/read-write-memory-dual-register-write-command-30.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
