Packet Structure


All examples in this manual use BIG ENDIAN NO SWAPPING floating point format.

A packet of data transmitted by a MASTER node will look something like the following example:
[Address (1 byte)][Function Code (1 byte)][Register Start Address (2 bytes)][Number of Registers Required (2 bytes)][CRC error check (2 bytes)]
Request the measured voltages of a meter (Modbus addresses 30004 to 30006) from SLAVE 2.
Modbus address 30004 = Meter address (30004 - 30001) * 2 = 6 = 06h
The packet to send will be,
[02][04][0006][0006][CRC][CRC]
The packet returned will be,
[02][04][0C][12 bytes of data (three floating point measurements)] [CRC][CRC]

Sample Coding
Read
Slave Address = 1
Reading 6, 3X Registers - code 4
V1 = 239.9V, V2 = 239.7V, V3 = 239.7V
I1 = 499.8A, I2 = 499.3A, I3 = 499.3A
Start Address = 6, number of WORD registers required = 12 (0C hex)
Number of values returned = 6, 32 bit floating point (24 bytes)


Message Packet To SLAVE
01 04 00 06 00 0C 10 0E

Response Packet From SLAVE
01 04 18 43 6F E2 28 43 6F A9 C8 43 6F A9 C8 43 F9 E0 E9 43 F9 A6 31 43 F9 A6 31 EC 6D

Write
Slave Address = 1
Writing To 4X Registers - code 16 (10 hex)
Changing system Voltage to 220V

Message Packet To SLAVE
01 10 00 00 00 02 04 43 5C 00 00 26 39
N.B. 43 5C 00 00 = 220

Response Packet From SLAVE
01 10 00 00 00 02 41 C8