1.eastron SDM530-Modbus Smart Meter Modbus Protocol Implementation V1.1
1.eastron SDM530-Modbus Smart Meter Modbus Protocol Implementation V1.1
1.eastron SDM530-Modbus Smart Meter Modbus Protocol Implementation V1.1
Eastron offers the option of an RS485 communication facility for direct connection to SCADA
or other communications systems using the Modbus Protocol RTU salve protocol. The
Modbus Protocol establishes the format for the master’s query by placing into it the device
address, a function code defining the requested action, any data to be sent, and an error
checking field. The slave’s response message is also constructed using Modbus Protocol. It
contains fields confirming the action taken, any data to be returned, and an error-checking field.
If an error occurs in receipt of the message, SDM530-Modbus will make no response. If the
SDM530-Modbus is unable to perform the requested action, it will construct an error message
and send it as the response.
The electrical interface is 2-wire RS485, via 2 screw terminals. Connection should be made
using twisted pair screened cable (Typically 22 gauge Belden 8761 or equivalent). All "A" and
"B" connections are daisy chained together. Line topology may or may not require terminating
loads depending on the type and length of cable used. Loop (ring) topology does not require
any termination load. The impedance of the termination load should match the impedance of
the cable and be at both ends of the line. The cable should be terminated at each end with a
120 ohm (0.25 Watt min.) resistor. A total maximum length of 3900 feet (1200 meters) is
allowed for the RS485 network. A maximum of 32 electrical nodes can be connected, including
the controller. The address of each Eastron can be set to any value between 1 and 247.
Broadcast mode (address 0) is supported.
Notes:
1. The power factor has its sign adjusted to indicate the nature of the load. Positive for capacitive and
negative for inductive.
2. There is a user option to select either k or M for the energy prefix.
3. The same user option as in 2 above gives a prefix of none or k for Amp hours
4. The power sum demand calculation is for import power only
5. The negative total system power factor is a sign inverted version of parameter 32, the magnitude is the
same as parameter 32.
6. There is a user option to select None, k or M for the energy prefix.
Modbus
Protocol
Address Parameter Paramet- Start
Register Number er Address Valid range Mode
Hex
High Low
Byte Byte
Read minutes into first demand
calculation. When the Demand
Demand
40001 1 00 00 Time reaches the Demand r
Time
Period then the demand values
are valid.
Demand Write demand period: 0, 5,8,
40003 2 00 02 r/w
Period 10,
15, 20, 30 or 60 minutes,
default 60. Setting the period to
0 will cause the demand to
show the
current parameter value, and
demand max to show the
maximum parameter value
since last demand reset.
System system voltage
40007 4 00 06 r
Volts
System system current
40009 5 00 08 r
Current
Relay 1 Write relay on period in
40013 7 Pulse 00 OC milliseconds: 60, 100 or 200, r/w
Width default 100.
Write any value to password lock
protected registers.
Read password lock status:
Password
40015 8 00 OE 0 = locked. 1 = unlocked. r
Lock
Reading will also reset the
password timeout back to one
minute.
Write the network port
parity/stop bits for MODBUS
Network Protocol, where: 0 = One stop
40019 10 Parity 00 12 bit and no parity, default. 1 = r/w
Stop One stop bit and even parity. 2
= One stop bit and odd parity.3
= Two stop bits and no parity.
Write the network port node
Network address: 1 to 247 for MODBUS
40021 11 00 14 r/w
Node Protocol, default 1. Requires a
restart to become effective.
Write pulse divisor index: n
= 0,1,2,3,4,5
0—0.0025kw/imp
(dft,400imp/kwh)(default)
Pulse
40023 12 00 16 1--0.01kwh/imp r/w
Divisor1
2--0.1kwh/imp
3--1kwh/imp
4--10kwh/imp
5--100kwh/imp
Write password for access to
40025 13 Password 00 18 r
protected registers.
Write the network port baud
rate for MODBUS Protocol,
Network where:
40029 15 Baud 00 1C 0 = 2400 baud. 1 = 4800 baud. r/w
Rate 2 = 9600 baud, default.5=1200
baud.
PARAMETER
Mode of Operation Differential
Number of Drivers and Receivers 32 Drivers, 32 Receivers
Maximum Cable Length 1200 m
Maximum Data Rate 10 M baud
Maximum Common Mode Voltage 12 V to –7 V
Minimum Driver Output Levels (Loaded) +/– 1.5 V
Minimum Driver Output Levels (Unloaded) +/– 6 V
Drive Load Minimum 60 ohms
Driver Output Short Circuit Current Limit 150 mA to Gnd,
250 mA to 12 V
250 mA to –7 V
Minimum Receiver Input Resistance 12 kohms
Receiver Sensitivity +/– 200 mV
Further information relating to RS485 may be obtained from either the EIA or the various
RS485 device manufacturers, for example Texas Instruments or Maxim Semiconductors. This
list is not exhaustive.
There must be no more than two wires connected to each terminal, this ensures that a “Daisy
Chain or “straight line” configuration is used. A “Star” or a network with “Stubs (Tees)” is not
recommended as reflections within the cable may result in data corruption.
2.3 A and B terminals
The A and B connections to the Eastron Digital meter products can be identified by the signals
present on them whilst there is activity on the RS485 bus:
2.4 Troubleshooting
·Start with a simple network, one master and one slave. With Eastron Digital meter products this is easily
achieved as the network can be left intact whilst individual instruments are disconnected by removing the
RS485 connection from the rear of the instrument.
·Check that the network is connected together correctly. That is all of the “A’s” are connected together,
and all of the “B’s” are connected together, and also that all of the “Gnd’s” are connected together.
·Confirm that the data “transmitted” onto the RS485 is not echoed back to the PC on the RS232
lines.(This facility is sometimes a link option within the converter). Many PC based packages seem to not
perform well when they receive an echo of the message they are transmitting. SpecView and PCView
(PC software) with a RS232 to RS485 converter are believed to include this feature.
·Confirm that the Address of the instrument is the same as the “master” is expecting.
·If the “network” operates with one instrument but not more than one check that each instrument has a
unique address.
·Each request for data must be restricted to 40 parameters or less. Violating this requirement will impact
the performance of the instrument and may result in a response time in excess of the specification.
·Check that the MODBUS Protocol mode (RTU or ASCII) and serial parameters (baud rate, number of
data bits, number of stop bits and parity) are the same for all devices on the network.
·Check that the “master” is requesting floating-point variables (pairs of registers placed on floating point
boundaries) and is not “splitting” floating point variables.
·Check that the floating-point byte order expected by the “master” is the same as that used by Eastron
Digital meter products. (PCView and Citect packages can use a number of formats including that
supported by Eastron Digital meter).
·If possible obtain a second RS232 to RS485 converter and connect it between the RS485 bus and an
additional PC equipped with a software package, which can display the data on the bus. Check for the
existence of valid requests.
In the MODBUS Protocol the master can address individual slaves, or, using a special
“Broadcast” address, can initiate a broadcast message to all slaves. The Eastron Digital meter
do not support the broadcast address.
Response
The example illustrates the normal response to a request for a single floating point parameter
i.e. two 16-bit Modbus Protocol Registers.
First Byte Last Byte
First First Second Second Error Error
Slave Function Byte
Register Register Register Register Check Check
Address Code Count
(Hi) (Lo) (Hi) (Lo) (Lo) (Hi)
Slave Address: 8-bit value representing the address of slave that is responding.
Function Code: 8-bit value which, when a copy of the function code in the query, indicates that
the slave recognised the query and has responded. (See also Exception Response).
Byte Count: 8-bit value indicating the number of data bytes contained within this response
First Register (Hi)*: The top (most significant) eight bits of a 16-bit number representing the
first register requested in the query.
First Register (Lo)*: The bottom (least significant) eight bits of a 16-bit number representing
the first register requested in the query.
Second Register (Hi)*: The top (most significant) eight bits of a 16-bit number representing the
second register requested in the query.
Second Register (Lo)*: The bottom (least significant) eight bits of a 16-bit number representing
the second register requested in the query.
Error Check (Lo): The bottom (least significant) eight bits of a 16-bit number representing the
error check value.
Error Check (Hi): The top (most significant) eight bits of a 16-bit number representing the error
check value.
*These four bytes together give the value of the floating point parameter requested.
Exception Response
If an error is detected in the content of the query (excluding parity errors and Error Check
mismatch), then an error response (called an exception response), will be sent to the master.
The exception response is identified by the function code being a copy of the query function
code but with the most-significant bit set. The data contained in an exception response is a
single byte error code.
Coding System: Full 8-bit binary per byte. In this document, the value of each byte will be
shown as two hexadecimal characters each in the range 0-9 or A-F.
Line Protocol: 1 start bit, followed by the 8 data bits. The 8 data bits are sent with least
significant bit first.
User Option Of Parity No Parity and 2 Stop Bits
And Stop Bits: No Parity and 1 Stop Bit
Even Parity and 1 Stop Bit
Odd Parity and 1 Stop Bit.
User Option of Baud 2400; 4800 ; 9600 ;
The baud rate, parity and stop bits must be selected to match the master’s settings.
3.3 MODBUS Protocol Message Timing (RTU Mode)
A MODBUS Protocol message has defined beginning and ending points. The receiving
devices recognizes the start of the message, reads the “Slave Address” to determine if they
are being addressed and knowing when the message is completed they can use the Error
Check bytes and parity bits to confirm the integrity of the message. If the Error Check or parity
fails then the message is discarded.
In RTU mode, messages starts with a silent interval of at least 3.5 character times.
The first byte of a message is then transmitted, the device address.
Master and slave devices monitor the network continuously, including during the ‘silent’
intervals. When the first byte (the address byte) is received, each device checks it to find out if
it is the addressed device. If the device determines that it is the one being addressed it records
the whole message and acts accordingly, if it is not being addressed it continues monitoring for
the next message.
Following the last transmitted byte, a silent interval of at least 3.5 character times marks the
end of the message. A new message can begin after this interval.
In the Eastron 1000 and 2000, a silent interval of 60msec minimum is required in order to
guarantee successful reception of the next request.
The entire message must be transmitted as a continuous stream. If a silent interval of more
than 1.5 character times occurs before completion of the message, the receiving device
flushes the incomplete message and assumes that the next byte will be the address byte of a
new message.
Similarly, if a new message begins earlier than 3.5 character times following a previous
message, the receiving device may consider it a continuation of the previous message. This
will result in an error, as the value in the final CRC field will not be valid for the combined
messages.
Transmit Character = Start Bit + Data Byte + 2 Stop Bits (11 bits total):
Start 1 2 3 4 5 6 7 8 Stop Stop
The master is configured by the user to wait for a predetermined timeout interval. The master
will wait for this period of time before deciding that the slave is not going to respond and that
the transaction should be aborted. Care must be taken when determining the timeout period
from both the master and the slaves’ specifications. The slave may define the ‘response time’
as being the period from the receipt of the last bit of the query to the transmission of the first bit
of the response. The master may define the ‘response time’ as period between transmitting the
first bit of the query to the receipt of the last bit of the response. It can be seen that message
transmission time, which is a function of the baud rate, must be included in the timeout
calculation.
BEGIN
Error Word = Hex (FFFF)
FOR Each byte in message
Error Word = Error Word XOR byte in message
FOR Each bit in byte
LSB = Error Word AND Hex (0001)
IF LSB = 1 THEN Error Word = Error Word – 1
Error Word = Error Word / 2
IF LSB = 1 THEN Error Word = Error Word XOR Hex (A001)
NEXT bit in byte
NEXT Byte in message
END
Where:
S represents the sign bit where 1 is negative and 0 is positive
E is the 8-bit exponent with an offset of 127 i.e. an exponent of zero is represented by 127, an
exponent of 1 by 128 etc.
M is the 23-bit normal mantissa. The 24th bit is always 1 and, therefore, is not stored.
Using the above format the floating point number 240.5 is represented as 43708000 hex:
Data Hi Reg, Data Hi Reg, Data Lo Reg, Data Lo Reg,
Hi Byte Lo Byte Hi Byte Lo Byte
43 70 80 00
The following example demonstrates how to convert IEEE 754 floating-point numbers from
their hexadecimal form to decimal form. For this example, we will use the value for 240.5
shown above
Note that the floating-point storage representation is not an intuitive format. To convert this
value to decimal, the bits should be separated as specified in the floating-point number storage
format table shown above.
For example:
Data Hi Reg, Data Hi Reg, Data Lo Reg, Data Lo Reg,
Hi Byte Lo Byte Hi Byte Lo Byte
0100 0011 0111 0000 1000 0000 0000 0000
From this you can determine the following information.
·The sign bit is 0, indicating a positive number.
·The exponent value is 10000110 binary or 134 decimal. Subtracting 127 from 134 leaves 7,
which is the actual exponent.
·The mantissa appears as the binary number 11100001000000000000000
There is an implied binary point at the left of the mantissa that is always preceded by a 1. This
bit is not stored in the hexadecimal representation of the floating-point number. Adding 1 and
the binary point to the beginning of the mantissa gives the following:
1.11100001000000000000000
Now, we adjust the mantissa for the exponent. A negative exponent moves the binary point to
the left. A positive exponent moves the binary point to the right. Because the exponent is 7, the
mantissa is adjusted as follows:
11110000.1000000000000000
Finally, we have a binary floating-point number. Binary bits that are to the left of the binary
point represent
the power of two corresponding to their position. For example, 11110000 represents (1 x 2 7) +
(1 x 26) + (1x 25) + (1 x 24) + (0 x 23)+ (0 x 22) + (0 x 21)+ (0 x 20) = 240.
Binary bits that are to the right of the binary point also represent a power of 2 corresponding to
their position. As the digits are to the right of the binary point the powers are negative. For
example: .100 represents (1 x 2-1) + (0 x 2-2)+ (0 x 2-3) + … which equals 0.5.
Adding these two numbers together and making reference to the sign bit produces the number
+240.5.
For each floating point value requested two MODBUS Protocol registers (four bytes) must be
requested. The received order and significance of these four bytes for Eastron Digital meters is
shown below:
Data Hi Reg, Data Hi Reg, Data Lo Reg, Data Lo Reg,
Hi Byte Lo Byte Hi Byte Lo Byte
Example
The following query will request ‘Volts 1’ from an instrument with node address 1:
Field Name Example(Hex)
Slave Address 01
Function 04
Starting Address High 00
Starting Address Low 00
Number of Points High 00
Number of Points Low 02
Error Check Low 71
Error Check High CB
Note: Data must be requested in register pairs i.e. the “Starting Address“ and the “Number of
Points” must be even numbers to request a floating point variable. If the “Starting Address” or
the “Number of points” is odd then the query will fall in the middle of a floating point variable
the product will return an error message.
The following response returns the contents of Volts 1 as 230.2. But see also “Exception
Response” later.
The following response returns the contents of Demand Time as 1, But see also “Exception
Response” later.
Field Name Example (Hex)
Slave Address 01
Function 03
Byte Count 04
Data, High Reg, High Byte 3F
Data, High Reg, Low Byte 80
Data, Low Reg, High Byte 00
Data, Low Reg, Low Byte 00
Error Check Low F7
Error Check High CF
Note: Data must be written in register pairs i.e. the “Starting Address“ and the “Number of
Points” must be even numbers to write a floating point variable. If the “Starting Address” or the
“Number of points” is odd then the query will fall in the middle of a floating point variable the
product will return an error message. In general only one floating point value can be written per
query
The following response indicates that the write has been successful. But see also “Exception
Response”later.
Field Name Example (Hex)
Slave Address 01
Function 10
Starting Address High 00
Starting Address Low 02
Number of Registers High 00
Number of Registers Low 02
Error Check Low E0
Error Check High 08
3.12 Diagnostics
MODBUS Protocol code 08 provides a number of diagnostic sub-functions. Only the “Return
Query Data” sub-function (sub-function 0) is supported on Eastron Digital meters.
Example
The following query will send a diagnostic “return query data” query with the data elements set
to Hex(AA) and Hex(55) and will expect these to be returned in the response:
Field Name Example (Hex)
Slave Address 01
Function 08
Sub-Function High 00
Sub-Function Low 00
Data Byte 1 AA
Data Byte 2 55
Error Check Low 5E
Error Check High 94
Note: Exactly one register of data (two bytes) must be sent with this function.
The following response indicates the correct reply to the query, i.e. the same bytes as the
query.
Field Name Example (Hex)
Slave Address 01
Function 08
Sub-Function High 00
Sub-Function Low 00
Data Byte 1 AA
Data Byte 2 55
Error Check Low 5E
Error Check High 94