You are on page 1of 1

Modbus addressing

The first information in each Modbus message is the address of the receiver. This parameter contains one byte of information.
In Modbus/ASCII it is coded with two hexadecimal characters, in Modbus/RTU one byte is used. Valid addresses are in the
range 0..247. The values 1..247 are assigned to individual Modbus devices and 0 is used as a broadcast address. Messages
sent to the latter address will be accepted by all slaves. A slave always responds to a Modbus message. When responding it
uses the same address as the master in the request. In this way the master can see that the device is actually responding to
the request.

Within a Modbus device, the holding registers, inputs and outputs are assigned a number between 1 and 10000. One would
expect, that the same addresses are used in the Modbus messages to read or set values. Unfortunately this is not the case. In
the Modbus messages addresses are used with a value between 0 and 9999. If you want to read the value of output (coil) 18
for example, you have to specify the value 17 in the Modbus query message. More confusing is even, that for input and holding
registers an offset must be substracted from the device address to get the proper address to put in the Modbus message
structure. This leads to common mistakes and should be taken care of when designing applications with Modbus. The following
table shows the address ranges for coils, inputs and holding registers and the way the address in the Modbus message is
calculated given the actual address of the item in the slave device.

You might also like