User Manual
Z-SG2 / Z-SG2-L
ALL RIGHTS RESERVED. NO PART OF THIS PUBLICATION MAY
BE REPRODUCED WITHOUT PRIOR PERMISSION.
www.seneca.it
Doc: MI-005370-EN
Rev. 6
Page 42
BIT CONVENTION WITHIN A MODBUS HOLDING REGISTER
16.2.
A Modbus Holding Register consists of 16 bits with the following convention:
BIT
15
BIT
14
BIT
13
BIT
12
BIT
11
BIT
10
BIT
9
BIT
8
BIT
7
BIT
6
BIT
5
BIT
4
BIT
3
BIT
2
BIT
1
BIT
0
For instance, if the value of the register in decimal is
12300
the value 12300 in hexadecimal is:
0x300C
the hexadecimal 0x300C in binary value is:
11 0000 0000 1100
So, using the above convention, we get:
BIT
15
BIT
14
BIT
13
BIT
12
BIT
11
BIT
10
BIT
9
BIT
8
BIT
7
BIT
6
BIT
5
BIT
4
BIT
3
BIT
2
BIT
1
BIT
0
0
0
1
1
0
0
0
0
0
0
0
0
1
1
0
0
MSB and LSB BYTE CONVENTION WITHIN A MODBUS HOLDING REGISTER
16.3.
A Modbus Holding Register consists of 16 bits with the following convention:
BIT
15
BIT
14
BIT
13
BIT
12
BIT
11
BIT
10
BIT
9
BIT
8
BIT
7
BIT
6
BIT
5
BIT
4
BIT
3
BIT
2
BIT
1
BIT
0
LSB Byte (Least Significant Byte) defines the 8 bits ranging from Bit 0 to Bit 7 included, we define MSB Byte
(Most Significant Byte) the 8 bits ranging from Bit 8 to Bit 15 inclusive:
BIT
15
BIT
14
BIT
13
BIT
12
BIT
11
BIT
10
BIT
9
BIT
8
BIT
7
BIT
6
BIT
5
BIT
4
BIT
3
BIT
2
BIT
1
BIT
0
BYTE MSB
BYTE LSB
REPRESENTATION OF A 32-BIT VALUE IN TWO CONSECUTIVE MODBUS HOLDING
16.4.
REGISTERS
The representation of a 32-bit value in the Modbus Holding Registers is made using 2 consecutive Holding
Registers (a Holding Register is a 16-bit register). To obtain the 32-bit value it is therefore necessary to read
two consecutive registers: