Modbus communication examples - HPP271

HPP271 User Guide

Document code
M211888EN
Revision
E
Language
English
Product
HPP271
Document type
User guide

Reading H2O2 concentration value

Device address used in the following examples is 240 (F0hex).

The values returned by the device differ depending on the ambient conditions and/or device settings. Your device might not return exactly same values.

Request Response
Bytes on the line (hexadecimal) Description Bytes on the line (hexadecimal) Description
(silence for 3.5 bytes) Start of Modbus RTU frame (silence for 3.5 bytes) Start of Modbus RTU frame
F0hex HPP271 address F0hex HPP271 address
03hex Function (Read Holding Registers) 03hex Function (Read Holding Registers)
00hex Register address 04hex Number of data bytes
00hex D4hex Value of first register (least significant word)
00hex Number of 16-bit registers to read (2) 7Ahex
02hex 43hex Value of second register (most significant word)
D1hex Modbus RTU checksum E8hex
2Ahex 33hex Modbus RTU checksum
(silence for 3.5 bytes) End of Modbus RTU frame ABhex
(silence for 3.5 bytes) End of Modbus RTU frame
Communication description
Register address 1 (1-based Modbus documentation format) = 0000hex (0-based format used in actual communication).
Data format Two 16-bit Modbus registers interpreted as IEEE 754 binary32 floating point value, least significant word first.
Returned value 43E8D47Ahex, which is binary32 representation of 465.65997 (ppm).

Writing purge interval value

Request Response
Bytes on the line (hexadecimal) Description Bytes on the line (hexadecimal) Description
(silence for 3.5 bytes) Start of Modbus RTU frame (silence for 3.5 bytes) Start of Modbus RTU frame
F0hex HPP271 address F0hex HPP271 address
10hex Function (Write Multiple Registers) 10hex Function (Write Multiple Registers)
03hex Register address 03hex Register address
08hex 08hex
00hex Number of registers to write (1) 00hex Number of 16-bit registers written (1)
01hex 01hex
02hex Number of data bytes 95hex Modbus RTU checksum
0Bhex Value for the register 6Ehex
40hex (silence for 3.5 bytes) End of Modbus RTU frame
9Bhex Modbus RTU checksum

The response to a write function informs that the function was correctly received by the device. It does not guarantee that the written value was accepted by the device (for example, in case out-of-range values).

To verify that the value was really accepted by the device, read the register value after writing.

4Chex
(silence for 3.5 bytes) End of Modbus RTU frame
Communication description
Register address 777 (1-based Modbus documentation format) = 0308hex (0-based format used in actual communication).
Data format One 16-bit Modbus register interpreted as 16-bit integer value.
Value to write 0B40hex = 2880 (minutes) (= 48 hours)