Modbus communication examples - GMP251 - GMP80P

GMP251 and GMP80P User Guide

Document code
M211799EN
Revision
K
Language
English
Product
GMP251
GMP80P
Document type
User guide

Reading CO2 value

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

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
0xF0 GMP25x address 0xF0 GMP25x address
0x03 Function (Read Holding Registers) 0x03 Function (Read Holding Registers)
0x00 Register address 0x04 Number of data bytes
0x00 0xD4 Value of first register (least significant word)
0x00 Number of 16-bit registers to read (2) 0x7A
0x02 0x43 Value of second register (most significant word)
0xD1 Modbus RTU checksum 0xE8
0x2A 0x33 Modbus RTU checksum
(silence for 3.5 bytes) End of Modbus RTU frame 0xAB
(silence for 3.5 bytes) End of Modbus RTU frame
Communication description
Register address 1 (1-based Modbus documentation format) = 0x0000 (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 43E8D47Ah, which is binary32 representation of 465.65997 (ppm).

Writing volatile compensation pressure 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
0xF0 GMP25x address 0xF0 GMP25x address
0x10 Function (Write Multiple Registers) 0x10 Function (Write Multiple Registers)
0x02 Register address 0x02 Register address
0x08 0x08
0x00 Number of registers to write (2) 0x00 Number of 16-bit registers written (2)
0x02 0x02
0x04 Number of data bytes 0xD4 Modbus RTU checksum
0x50 Value for the first register (least significant word) 0x93
0x00 (silence for 3.5 bytes) End of Modbus RTU frame
0x44 Value for the second register (most significant word)

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 of out-of-range values).

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

0x7D
0x0E Modbus RTU checksum
0xB7
(silence for 3.5 bytes) End of Modbus RTU frame
Communication description
Register address 521 (1-based Modbus documentation format) = 0x0208 (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.
Value to write 1013.25 (hPa), in binary32 format 0x447D5000.