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

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

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

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.510=40B00000165.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.

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

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

Last updated