# 讀寫型記憶體雙Register寫入指令(30)

{% hint style="info" %}
限使用在 Register 長度為 2 的記憶體，請參考[列表](/qr/fp-as510-paddle-wheel-flowmeter-manual-chinese-v2/communication/modbus-rtu-protocol/read-write-memory-list.md)。
{% endhint %}

| Register 位置 | 記憶體內容          | 資料型式     |
| ----------- | -------------- | -------- |
| 0001        | scale factor   | float 32 |
| 0304        | upper limit    | float 32 |
| 0306        | lower limit    | float 32 |
| 030B        | Total Target   | float 32 |
| 0406        | 0mA/4mA Value  | float 32 |
| 0408        | 20mA Value     | float 32 |
| 040B        | 0mA/4mA Adjust | float 32 |
| 040D        | 20mA Adjust    | float 32 |

## 指令範例

### 控制端發指令(30)格式

| Byte#      | 1             | 2             | 3        | 4        | 5    | 6    | 7    | 8    | 9   | 10  |
| ---------- | ------------- | ------------- | -------- | -------- | ---- | ---- | ---- | ---- | --- | --- |
| Node ID    | Slave Address | Function Code | 寫入的記憶體地址 | 寫入的記憶體地址 | 寫入資料 | 寫入資料 | 寫入資料 | 寫入資料 | CRC | CRC |
| 範例內容01\~FF | 01            | 30            | 00       | 01       | 40   | 20   | 00   | 00   | 98  | 0E  |

#### 控制端發訊範例說明

這個範例會改變 A02 Scale Factor 數值變成 2.50

slave address: 01(本流量計地址)

function code: 30(雙Register寫入指令)

讀取數據的啟始地址: 0001(要寫入記憶體地址)

寫入資料: 40 20 00 00(改變 A02 Scale Factor 數值變成 2.50)

CRC:  98 0E(依 CRC 算法計算出的糾錯碼)

### 流量計回覆(30)格式

| Byte#      | 1             | 2             | 3        | 4        | 5    | 6    | 7    | 8    | 9   | 10  |
| ---------- | ------------- | ------------- | -------- | -------- | ---- | ---- | ---- | ---- | --- | --- |
| Node ID    | Slave Address | Function Code | 寫入的記憶體地址 | 寫入的記憶體地址 | 寫入資料 | 寫入資料 | 寫入資料 | 寫入資料 | CRC | CRC |
| 範例內容01\~FF | 01            | 30            | 00       | 01       | 40   | 20   | 00   | 00   | 98  | 0E  |

#### 流量計回覆範例說明

寫入指令符合格式，會將收到的控制端指令回傳給 Master

slave address: 01(本流量計地址)

function code: 30(雙Register寫入指令)

讀取數據的啟始地址: 0001(要寫入記憶體地址)

寫入資料: 40 20 00 00(改變 A02 Scale Factor 數值變成 2.50)

CRC:  98 0E(依 CRC 算法計算出的糾錯碼)


---

# 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-as510-paddle-wheel-flowmeter-manual-chinese-v2/communication/modbus-rtu-protocol/read-write-memory-double-register-write-instruction-30.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.
