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.
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:
Register Length: 2 (two registers)
1. Value Conversion and Data Preparation (Hex Data)
Convert the decimal value +5.5 to IEEE 754 Float32 (Big Endian) format.
5.510=40B0000016 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.
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.
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.