Using Modbus nomenclature, four available groups of data flags and registers contain all accessible data in a Modbus server. this includes the Modbus-master access.
A Modbus device is not required to contain all four groups of data. For example, a metering device may contain only holding registers. However, for each data group implemented, an address convention is used. Requests for data (made to a device) must specify a data address (and range) of interest.
| Group | Address convention |
|---|---|
| Coils | 00000 - 0nnnn decimal, or 0x |
| Inputs | 10000 - 1nnnn decimal, or 1x |
| Input Registers | 30000 - 3nnnn decimal, or 3x |
| Holding Registers | 40000 - 4nnnn decimal, or 4x |
Data addressing (at least in decimal and hex formats) is zero-based, where the first instance of a data item, for example coil 1, is addressed as item number 0. As another example, holding register 108 is addressed as 107 decimal or 006B hex. However, it is common for a vendor to list a device’s data items using a 5-digit Modbus address, for example, holding registers starting with 40001.
| Modbus Addr. | Units | Description | Data Type |
|---|---|---|---|
| 40001 | kWH |
Energy Consumption, LSW |
Integer (multiplication required) |
| 40002 | kWH |
Energy Consumption, MSW |
Integer (multiplication required) |
| 40003 | kW |
Demand (power) |
Integer (multiplication required) |
| 40004 | VAR |
Reactive Power |
Integer (multiplication required) |
| 40005 | VA |
Apparent Power |
Integer (multiplication required) |
| 40006 |
— |
Integer (multiplication required) |
|
| 40007 | Volts |
Voltage, line to line |
Integer (multiplication required) |
| 40008 | Volts |
Voltage, line to neutral |
Integer (multiplication required) |
| 40009 | Amps |
Current |
Integer (multiplication required) |
| 40010 | kW |
Demand (power), phase A |
Integer (multiplication required) |
| 40011 | kW |
Demand (power), phase B |
Integer (multiplication required) |
| 40012 |
Demand (power), phase B |
Integer (multiplication required) |
|
| 40013 |
— |
Power Factor, phase A |
Integer (multiplication required) |
| 40014 |
— |
Power Factor, phase B |
Integer (multiplication required) |
| 40015 |
— |
Power Factor, phase C |
Integer (multiplication required) |
|
— |
— |
— |
— |
| 40259 | kWH |
Energy Consumption |
Float, upper 16 bits |
| 40260 | kWH |
Energy Consumption |
Float, lower 16 bits |
| 40261 | kW |
Demand (power) |
Float, upper 16 bits |
| 40262 | kW |
Demand (power) |
Float, lower 16 bits |
Within any particular data group (coils, inputs, input registers, holding registers), it is typical for a Modbus device to use consecutive addresses, particularly for related data. For example, in the example, holding registers 40001-40015 are used consecutively for integer data, where each is a separate, integer, data point.
Register 40259 begins a consecutive series of holding registers used to access floating point data values. However, an address gap exists in this case. The address gap (while not necessary), was probably implemented by the device vendor for clarity.
Also, floating-point data values (being 32-bit based) require the use of two consecutive registers for each data point.
Modbus messaging supports device queries for data using both a starting address and range, which is dependent on data items being consecutively addressed. This allows for message efficiency when retrieving multiple data points, as it can be handled in one message response.
The address range for data in any data group (coils, inputs, input registers, holding registers) received in a query must be implemented by the receiving device—otherwise, it will generate an exception response. For example, a read request of holding registers 40003—40015 to the device represented by in the table receives a normal response (data values), while a similar request to registers 40003-40017 results in an illegal data address response (as holding registers 40016 and 17 are not implemented).
A Modbus driver integration makes use of consecutively addressed data in two ways: