# 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**.
{% endhint %}

#### Function Code 30

The Dual Register Write command (Function Code 30) writes data to two consecutive registers (32-bit / 4 bytes).\
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, Set A23 Zero Offset to −0.08.

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

![](https://4028902321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSBz5Tlpy8GCIkK4ygkgZ%2Fuploads%2F9Y7r1ax2yImIPfrhHP3U%2Fmodbus-30-TX-diagram-en.png?alt=media\&token=6c003763-0187-44dc-a0e0-5aa50dc01579)

![](https://4028902321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSBz5Tlpy8GCIkK4ygkgZ%2Fuploads%2FwEs72MDWBy7kU6ImRSdT%2Fmodbus-30-RX-diagram-en.png?alt=media\&token=15b34a35-c448-42df-953d-51a890c5bcb7)

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

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 00 02 04 40 B0 00 00 27 D1
```

* 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 00 02 D1 CB
```

* 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**.
