Ethernet Analogue DIO
Product Manual V1.2
© Copyright Brainboxes Ltd
Page 94 of 100
Logical addressing
Within the messages passed between Modbus devices, the addresses for registers, coils and inputs are always
16-bit values, which can express values from 0 to 65535. The Logical address is simply this number, expressed
in hexadecimal. Each of the types of addressable object (coils, discrete inputs, holding registers and input
registers) have their own independent “address space”: there can be a coil with address 123 and a holding
register with address 123, and there is no relationship implied between them. So when using logical
addressing, the type of object/access type always has to be stated as well. A logical address may be written as
a decimal or a hexadecimal number: we write them as hexadecimal, indicated by a ‘0x’ prefix.
984 style addressing
Modbus started life as a proprietary standard based on a family of programmable controllers, and the
addressing notation from the early version of this standard, although now officially superseded, is still widely
used. It is often called 984 addressing, after the model of programmable controller which popularised it. In
this address notation, the address is always written in decimal, with an offset of 1 from the logical address. It
is then padded out with leading zeroes to 4 digits (so logical address 20 becomes 0021), and then a prefix digit
is added to indicate which address space is to be used, making a 5-digit written address. So, logical address 20
would become 00021 if it referred to a coil address, 10021 if it was a discrete input, 30021 for an input register
or 40021 for a holding register. You may also see 4-digit or 6-digit versions of this scheme.
984 addresses
Type
Logical addresses
00001-09999
Coil
0-9998 (decimal)
0x0000-0x270E (hexadecimal)
10001-19999
Discrete input
0-9998 (decimal)
0x0000-0x270E (hexadecimal)
30001-39999
Input register
0-9998 (decimal)
0x0000-0x270E (hexadecimal)
40001-49999
Holding register
0-9998 (decimal)
0x0000-0x270E (hexadecimal)
The prefix digit is sometimes used as shorthand for the type of access: ‘0x’ referring to coils (not to be
confused with the 0x which indicates a hexadecimal number!), ‘1x’ referring to discrete inputs, ‘3x’ referring to
holding registers, and ‘4x’ referring to input registers.
IEC 61131 addressing
Programmable controllers and HMIs often use the IEC 61131 standard for referring to internal 1-bit values
(%M0, %M1, …) and 16-bit values (%MW0, %MW1, …). This notation is sometimes also applied to Modbus
addressing, with the %M0, %M1, … addresses referring to Modbus coils, and the %MW0, %MW1, … addresses
referring to Modbus holding registers. There is no way in this scheme to represent the read-only types.
IEC 61131 addresses
Type
Logical addresses
%M0-%M65535
Coil
0-65535 (decimal)
0x0000-0xFFFF (hexadecimal)
N/a
Discrete input
Not accessible in this format
N/a
Input register
Not accessible in this format
%MW0 - %MW65535
Holding register
0-65535 (decimal)
0x0000-0xFFFF (hexadecimal)