Modbus: holding registers
Modbus is a very simple protocol widely used in industrial and IoT automation systems. Data is stored in 16-bit holding registers, each with its own address (usually starting from 40001).
In some devices, textual data (such as a serial code) is distributed and written across multiple consecutive registers: the high byte (big byte) of each register is one ASCII character, and the low byte is the next ASCII character (meaning one register = 2 characters, big-endian).
Below are 16 holding registers read from the device. These are raw measurements from diagnostic sensors, but 5 registers starting from 40007 are the textual status code of the device:
| Register address | Value (hex) |
|---|---|
40001 | 0x3D21 |
40002 | 0x6ADD |
40003 | 0xB991 |
40004 | 0x8B6F |
40005 | 0xB571 |
40006 | 0x560E |
40007 | 0x5245 |
40008 | 0x4749 |
40009 | 0x5354 |
40010 | 0x525F |
40011 | 0x4F4B |
40012 | 0xEF23 |
40013 | 0xE695 |
40014 | 0x8A67 |
40015 | 0x4CA2 |
40016 | 0x6160 |
Select registers 40007..40011, convert each into 2 ASCII characters (high byte — first character, low byte — second character) and concatenate them sequentially: BAYROQ{IOT_MODBUS_<SOZ>}