Modbus registers

A Modbus device holds transient (real-time) data and often persistent (configuration) data in addressable registers. The term “register” implies all addressable data, but this is a loose interpretation.

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.

  • Coil status or, simply, coils are single-bit flags that represent the status of digital (Boolean) outputs from the server (slave), that is, On/Off output status. A Modbus master can both read from and write to coils.
  • Input status or, simply, inputs are single-bit flags that represent the status of digital (Boolean) inputs to the server (slave), that is, On/Off input status. A Modbus master can only read inputs.
  • Input registers are 16-bit registers that store data collected from the field by the Modbus server (slave). The Modbus master can read (only) input registers.
  • Holding registers are 16-bit registers that store general-purpose data in the Modbus server (slave). The Modbus master can both read from and write to holding registers.

Data addresses

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.

Example device register address documentation (portion)

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

Consecutive address numbering

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:
  • The New point window provides a Number to Add property, which assigns point register numbers in consecutive order.
  • Data polling in a client device may be improved by using device polls, where data values in consecutively addressed items are requested in a single message. This reduces network messaging traffic.