Read/Write Memory – Read Command (03)

circle-info

When reading large values using different data formats (e.g., Float32 or Int64) and performing conversions, very small differences may occur due to internal calculation methods, typically less than 1/10,000, which is considered normal.

Registers from different parameter categories cannot be read across categories. A single read command can access up to 40 registers. Requests exceeding this length will be ignored.

Function Code: 03

This command can read single or multiple holding registers, used to access configuration parameters defined in the device’s Holding Registers.

Read/Write Memory – Read Command (03) Format

Modbus RTU Example of Reading Read/Write Memory Holding Registers (03)

Using Function Code 03 to read the "A08 Pipe Material" register as an example:

According to the Read/Write Memory – Read List, the starting address is 000A, register length is 1 (one register), data type is Int16 (16-bit integer), and the number of registers to read is 0001 (1 register).

Per device specifications, A08 Pipe Material is stored as an Int16 (16-bit integer), occupying 1 register (2 bytes), with Big Endian byte order.

Master Sends Read Command (TX Frame) TX Request Command:

  • Slave Address = 01

  • Function Code = 03

  • Starting Register Address: 000A (A08 Pipe Material register)

  • Number of Registers to Read: 0001 (1 register)

  • CRC Checksum: A40E (Error-checking code calculated using the CRC algorithm)

Slave Response Data (RX Frame)

Assume the Pipe Material code is 3 (Hex: 0003).

RX Response Data:

  • Slave Address: 01

  • Function Code: 03

  • Byte Count: 02 (1 register, 2 bytes)

  • Data Bytes: 0003 (Pipe Material code – PP material)

  • CRC Checksum: B844 (Error-checking code calculated using the CRC algorithm)

Data Parsing and Conversion (to Decimal)

Step A – Arrange the Data

  • Received Data: 0003

  • Data Type: Int16 (16-bit integer)

Step B – Convert to Decimal and Map Material

  • Convert the hexadecimal value 0003 to decimal: Decimal Calculation: (0 × 256) + 3 = 3 Final Value: 3

  • Material Mapping: Refer to the A08 Pipe Material list. The value 3 corresponds to PP material.

FAQ

  • Why is there a difference between the “Memory Map” and the “PLC Read Address”?

Users may see that the memory map shows 40005, but in the PLC, you need to enter 4 (or 0004) to read the correct value.

This is due to Modbus addressing: human-readable addresses (memory map) and actual device read addresses (communication addresses) have a fixed offset.

For Function Code 03, 40001 is the base address. Reading starts from this base, so 40001 corresponds to offset 0000 and read address 0000.

Therefore, when the document indicates reading 40005, the actual starting address in the Modbus Function Code 03 packet is 0004, i.e.:

Actual communication address=Document address−40001

circle-info

Note: Modbus uses 0-based addressing (communication packets start from 0), So, in general : Actual communication address=Document address−40001.

BUT, if the PLC or HMI is set to 1-based addressing (software adds 1), enter the starting address according to the software’s rules to read the correct register.

Last updated