Energy meter

This unit measures and displays various important electrical parameters and provide a communication port for remote reading and monitoring. Bi-directional energy measurement makes the unit a good choice for solar PV energy metering. On this page you can learn how to connect the energy meter to your PC and communicate with it using Modbus RTU protocol.

modbus energy meter
Figure 1 - Modbus energy meter

Connect the energy meter to PC

To connect the energy meter to you PC, you need an RS485 to USB converter. It provides the connectivity between the PC and the serial port of the electric meter. The wiring diagram below (Figure 2) shows how to wire the Eastron SDM230-Modbus device and the USB converter together. For successful communication, additional settings are required on the device that you will find more information about below.

modbus energy meter wiring diagram
Figure 2 - Modbus energy meter wiring diagram

Specifications of modbus energy meter

The SDM230-Modbus is a single phase multi function energy meter with built-in RS485 Modbus port output, measuring active energy and other electrical parameters. The Table 1 shows the specifications below.

Specification Value
Accuracy Class 1/Class B
Standard IEC62053-21
Rated voltage (Un) 220/230V AC
Voltage range 0.8-1.2 Un
Base current (Ib) 5A
Max. current 100A
Mini current 0.5A
Starting current 0.4% of Ib
Power consumption <2W/10VA
Frequency 50/60Hz (+-2%)
Pulse 1 constant 1000/100/10/1 imp
Pulse 2 constant 1000 imp/kWh
Table 1 - Modbus energy meter specifications

The meter provides a RS485 port for remote communication. Modbus RTU is the protocol applied. For Modbus RTU, the following RS485 communication parameters can be configured from the Set-up menu, shown in Table 2. The default settings are: 2400 bit/s baud rate, no parity and slave ID is 1.

Parameter Value
Baud rate (bit/s) 1200 / 2400 / 4800 / 9600
Parity None / Even / Odd
Stop bits 1 or 2
Slave ID 1 - 247
Table 2 - Modbus energy meter parameters

Setting up the energy meter

When the device is powered on, the meter will initialize and do self-checking. During this time, the following device values are shown on the display: full screen, software version, Modbus ID, baud rate and total kWh. The values set on your energy meter must be used for communication. To modify these settings, please use the user manual.

modbus energy meter self checking
Figure 3 - Modbus energy meter self checking

About Modbus

Modbus is a serial communication protocol that uses command and response frames to implement the communication between one master and many slaves. Only one master is connected to the bus, and one or several (247 maximum) slaves are also connected to the same serial bus. The Modbus communication is always initiated by the master. There are several versions of Modbus protocol that you can find more information about under Connections. The master can write the register values of the slave device and get them by sending a command message. The slave device sends back a response one that contains the requested information.

Registers of Modbus energy meter

Input registers

Input registers are used to indicate the present values of the measured and calculated electrical quantities. Each parameter is held in two consecutive 16 bit register. The following table details the 3X register address, and the values of the address bytes within the message. Modbus protocol function code 04 is used to access all parameters.

Address
(Register)
SDM230-Modbus input register parameter Start address (hex)
Description Units Hi Byte Lo Byte
30001 Line to neutral volts Volts 00 00
30007 Current Amps 00 06
30013 Active power Watts 00 0C
30025 Reactive power VAr 00 18
30031 Power factor None 00 1E
30037 Phase angle Degree 00 24
30071 Frequency Hz 00 46
Table 3 - Modbus energy meter input registers

Holding registers

Holding registers are used to store and display instrument configuration settings. The holding register parameters may be viewed or changed using the Modbus protocol. Each parameter is held in two consecutive 4X registers. Modbus protocol function code 03 is used to read the parameter and function code 16 is used to write. Write to only one parameter per message.

Address
(Register)
Parameter Valid range Start address (hex)
Hi byte Lo byte
40013 Pulse output 1 width Write relay on period in milliseconds: 60, 100 (default) or 200.
Data format: float (length: 4 byte)
00 0C
463761 Pulse 1 constant 0000: 0.001kwh(kvarh)/imp (default)
0001: 0.01kwh(kvarh)/imp
0002: 0.1kwh(kvarh)/imp
0003: 1kwh(kvarh)/imp
Data format: hex (length: 2 byte)
F9 10
463776 Measurement mode 0001: mode 1 (total = import)
0002: mode 2 (total = import + export) (default)
0003: mode 3 (total = import - export)
Data format: hex (length: 2 byte)
F9 20
Table 4 - Modbus energy meter holding registers

These tables (Table 3 and Table 4) do not contain all the input and holding registers that the device supports. For more information about it, please download the energy meter documentation.

Energy meter Modbus command frame

The Modbus RTU command frame constructed from 1 byte address field which value can be set between 1 and 247. This is the ID of the energy meter (called slave). It followed by 1 byte function field. This device supports 3 type of function codes: 0x04 for reading measured and calculated electrical values, 0x03 for reading and 0x10 for writing settings. After that, there is a data field. This field length and its content depends on the function code. Finally, there are 2 bytes for the checksum field that calculated from the previous bytes using CRC16.

Address Function Data Checksum
Table 5 - Modbus ADU

Using 0x03 and 0x04 function codes, the data field contains information about which measured or setting data you would like to read. Using 0x10 function code, the data field stores information which register you would like to modify, and the value to write. The Table 6 below summarizes these.

Function code Format Description
03 hex-octet Read values of the measured and calculated electrical quantities
04 hex-octet Read values of instrument configuration settings
10 hex-octet Write values of instrument configuration settings
Table 6 - Modbus energy meter function codes

Examples

Read value of 'Volts 1'

The following query will request 'Volts 1' from an instrument with slave address 1.

Octet(s) Description Format In this example
01 slave ID hex-octet the slave ID of the energy meter is 1
04 function code hex-octet function code 4 reads the contents of the 3X registers
00 00 starting address hex-octet starting address of the register containing the 'Volts 1' value
00 02 register length hex-octet each register is 2 bytes long
71 CB checksum hex-octet checksum calculated from the previous 6 bytes using CRC16
Table 7 - Read value of 'Volts 1' command message

The following response returns the contents of 'Volts 1' as 230.2.

Octet(s) Description Format In this example
01 slave ID hex-octet the slave ID the message come from
04 function code hex-octet function code equals to the command message's function one
04 data length hex-octet the data length of the message (in byte)
43 66 33 34 data hex-octet converted to floating-point number: 230.2
1B 38 checksum hex-octet checksum calculated from the previous 6 bytes using CRC16
Table 8 - Read value of 'Volts 1' response message

Set value of 'Pulse output 1 width'

The following query will set the 'Pulse output 1 width' to 60 ms, which effectively resets the demand time.

Octet(s) Description Format In this example
01 slave ID hex-octet the slave ID of the energy meter is 1
10 function code hex-octet function code 16 (0x10) writes the contents of the 4X registers
00 0C starting address hex-octet starting address of the register containing the 'Pulse output 1 width' value
00 02 register length hex-octet each register 2 is bytes long
04 data length hex-octet the data length of the command message (in byte)
42 70 00 00 data hex-octet converted to floating-point number: 60
E6 59 checksum hex-octet checksum calculated from the previous 11 bytes using CRC16
Table 9 - Set value of 'Pulse output 1 width' command message

The following response indicates that the write has been successful.

Octet(s) Description Format In this example
01 slave ID hex-octet the slave ID the message come from
10 function code hex-octet equals to the command message's function one
00 02 data (1/2) hex-octet the data address of the first register
00 02 data (2/2) hex-octet the number of registers written
E0 08 checksum hex-octet checksum calculated from the previous 6 bytes using CRC16
Table 10 - Set value of 'Pulse output 1 width' response message

Product specifications

Eastron_SDM230-Modbus_user_manual_V1_4_2015.pdf
SDM230-Modbus protocol V1.2.pdf
eastron-sdm230.pdf

Where can I buy this energy meter

More information