You are on page 1of 5

238 ACTA ELECTROTEHNICA

IEC 62056-21 protocol based, Energy


Meter Integration on OPC Data Access
environment
Florin DRGAN, Romul COPNDEAN and Rodica HOLONEC
Abstract:The International Electrotechnical Commissions IEC 62056-21 standard suite describe direct local connections physical
layer and communication protocols used for Electricity energy metering -Data exchange for meter reading, tariff and load control.
This article describe a simple meter reading example, using optoisolated serial readout circuit and a software application using
OPC Client/Server environment solution. The system contains an energy meter (Actaris ACE 5000 family), one optoisolated serial
adapter connected to a process computer via serial communication port. The computer runs an application developed under OPC
Server environment, used for interface, channel protocol and device configuration and data acquisition reasons. OPC server
environment can integrate different devices interfaces and communication protocols and provides different parameter values as
abstract information. These information may be transferred to another computer station and used to be displayed by hardware or
software based HMI device, as can be see below. Some tricks and configuration details are also presented.
Keywords: Energy meter reading, DLMS/COSEM, OBIS codes, Data exchange, OPC platform, HMI

1. INTRODUCTION Based on RS-232 (EIA/TIA) serial port status and


control output signals, some tricks can be used to
There are many energy meter applications based supply simple data communication circuit. The +Vcc
on devices equipped with communication interfaces and Vcc power are supplied by computers RS232
providing measurement information. Interfaces, either DTR=ON and RTS=OFF signals, respectively.[2]
simple direct wired / optical isolated serial, or complex
wired / wireless network types, enable suppliers to Serial port and communication test
periodically read and/or control remotely, using The power meter used in this example (Actaris
appropriate devices and applications. In some cases, ACE5000 family) need following serial communication
continuous measuring and monitoring are needed, at settings, according to ISO/IEC 1177:1985 [1]:
customers premise. A simple solution is based on baud rate 1200 bps;
serial and IEC 61107 optical port connected to a 7 data bits;
computer running OPC.[1] parity even;
1 stop bit.

2. SERIAL COMMUNICATION CIRCUITS After plugging the cable adapter and powering up
the computer and energy meter, it is possible to test the
Some energy meters are equipped, either optical connection by using DOS emulated command line (on
isolated open collector and emitter transistor, or Windows command prompt). Pressing Start> Run>cmd
infrared output LED. Both solutions are similar, there and typing mode command line with appropriate
are only few differences, as shown in figure 1. parameters, a message is printed on screen.

Energy Data Energy Data


Meter Acquisition Meter Acquisition
Computer Computer
+ DTR DTR
output
output DSR, DCD DSR, DCD
pulse port
optical
port
C:\ ..default folder >mode com1:
-- RXD RXD
baud=1200 data=7 parity=e sto
2k2 CTS 2k2 CTS
ACE5000 RTS ACE5000 RTS

a) b)
p=1 dtr=on rts=off <ENTER>
Fig. 1. Optoisolated serial port readout circuit
Status for device COM1:

-----------------------

Baud: 1200
Volume 55, Number 3-4, 2013 239

Parity: Even 2.8.1*1(000000.000*kWh)(0 11-06-


0112:45:53)
Data Bits: 7
2.8.2*1(000000.000*kWh)(0 11-06-
Stop Bits: 1 0112:45:53)

Timeout: ON 2.8.0*1(000000.000*kWh)(0 11-06-


0112:45:53)
XON/XOFF: OFF
3.8.1(000001.005*kvarh)
CTS handshaking: ON
3.8.2(000000.000*kvarh)
DSR handshaking: OFF
3.8(000001.005*kvarh)
DSR sensitivity: OFF
3.8.1*1(000001.005*kvarh)(0 11-06-
DTR circuit: ON 0112:45:53)

RTS circuit: OFF 3.8.2*1(000000.000*kvarh)(0 11-06-


0112:45:53)

3.8.0*1(000001.005*kvarh)(0 11-06-
After com1 port configuration session, we can 0112:45:53)
read the exported frame, containing energy meter
1.6.1(000.000*kW)(0 11-06-0112:45:53)
parameters. The device automatically transmits
(periodically about 10s time stamp) the user 1.6.2(000.000*kW)(0 11-06-0112:45:53)
configurable, clear readable ASCII text, information
frame, as show below. 1.6.1*1(000.540*kW)(0 11-05-1016:30:00)

C:\..default folder>copy com1: con 1.6.2*1(000.000*kW)(0 11-05-0619:30:07)


<ENTER>
1.6(000.000*kW)(0 11-06-01 12:45:53)

1.6.0*1(000.540*kW)(0 11-05-10 16:30:00)


C.1( 00083115)
C.8.1(00000872*min)
C.1.1( )
C.8.2(00000000*min)
169.1(009-015-014-102-010-000)
C.8(00000872*min)
C.50.2(02)
32.7(216*V)
11.35.1(008*A)
52.7(222*V)
1.0(0 11-06-0212:32:47)
72.7(215*V)
15.8.1(000002.318*kWh)
32.26(239*V)
15.8.2(000000.000*kWh)
52.26(238*V)
15.8(000002.318*kWh)
72.26(240*V)
15.8.1*1(000002.318*kWh)(0 11-06-
0112:45:53) 31.7(000*A)

15.8.2*1(000000.000*kWh)(0 11-06- 51.7(000*A)


0112:45:53)
71.7(000*A)
15.8.0*1(000002.318*kWh)(0 11-06-
0112:45:53) 31.6.1(002*A)

2.8.1(000000.000*kWh) 31.6.2(000*A)

2.8.2(000000.000*kWh) 51.6.1(002*A)

2.8(000000.000*kWh) 51.6.2(000*A)
240 ACTA ELECTROTEHNICA

71.6.1(002*A) Table 1.
Data
name STX ! CR LF ETX BCC
71.6.2(000*A) block
variab
code 0x02 0x21 0x0D 0x0A 0x03 0x??
le
31.6(002*A)

51.6(002*A)
Data block contain a variable number of data sets,
71.6(002*A) depending on user configurable device settings. A data
set can be represented in one or more lines, separated
15.7(000.000*kW) by <CR> and <LF> characters, if needed. Each data
line can contain maximum 78 characters (80 with
1.16(002.440*kW) <CR> and <LF>). The data set format is show in table
2.
9.7(000000*VA) Table 2.
OBIS Param.
9.14(000000*VA) ( * Unit ) CR LF
code Value
variable 0x28 variable 0x2A Var. 0x29 0x0D 0x0A
13.7(+1.00)

33.7(+1.00)
To extract interested parameters, provided by
53.7(+1.00)
measure device, the received data message must be split
into data sets and each data set into parameter value and
73.7(+1.00) measurement unit. This paper describes a sample
solution, based on OPC DA environment, which solve
C.2(00005) the desired problem.[1]
C.66(00005)
4. OPC DA IMPLEMENTATION
C.7(043)
OPC (OLE for Process Control) was developed to
C.5(000000)
allow devices with different interfaces, channels and
protocols, to be integrated in a single remote data
! acquisition and monitoring virtual system. There are
many application packages provided by software
developer companies, in this paper Kepwares OPC
Server product is used.[6]
This message contains the short OBIS code (as The main parts are KEPServerEX with U-CON
defined by [3, 5]), of a parameter, value and measure (User Configurable) driver, for connection support and
unit, separated by special characters. Each parameter is data acquisition, and Infilink HMI (Kessler Ellis
printed in separate line, ended by a pair of Products) for user friendly graphic interface.[8]
<CR><LF>characters. To create an application project, several tasks
must be performed. OPC Server configuration involve
channel (interface and appropriate protocol), device and
tags properties configuration, as shown in figure 2-4.
3. IEC 62056-21 PROTOCOL FORMAT User Configurable Driver allows programmers to
create the script according to dedicated protocol to be
IEC 62056-21 international standard provides used. Because energy meter device transmits
electrical, mechanical and data exchange specification periodically data frames, without any external
support. There is a few protocol versions described in command, the unsolicited mode must be selected.[7]
this standard, but this device uses protocol format D.
Data exchange is unidirectional in protocol mode
D and permits readout only. The information flows
from the tariff device to the HHU. Data transmission is
initiated, for example by operating a push button or
other sensor on the tariff device [1]. In this case, the
device transmits data periodically, without any other
action.
The readout data message is a simple line based
parameter sequences string, with start/end delimiter
characters. To avoid data errors during transmission, a Fig. 2. OPC Server configuration, main window
block check sequence is also used. The general message
frame format is show in table 1. Serial port communication parameters must be
configured according to the energy measurement device
Volume 55, Number 3-4, 2013 241

specifications (baud rate, parity, data bits etc.). The After defining all tags and their parameters, the
readout circuit, as shown in figure 1, must be electrical next step is to create the chat script, that mean a
supplied by using unusual DTR flow control. sequence of write, read, conditional and processing
commands. The script allows drawing out each
parameter (tag), as shown in figure 5-6.

Fig. 5. OPC Server device configuration. Transaction editor main


window

Fig. 3. OPC Server channel configuration.

Fig. 6. Transaction editors chat script


Device configuration requires to setup some
parameters like name, device identification and
different time stamps indispensable to accommodate
reading sequences to energy meter data transmission.
One of the most important piece is the transaction
editor. In the left window, it is necessary to create a
read tag block, containing each parameter (tag)
exported by meter device. All this tags are read together
in a single data frame.[7]
Fig. 7. OPC Quick Client tags table window

For testing reason or simple reading interface.


prior to make the graphic interface, OPC Quick Client
can be used. OPC Server application can starts and
automatically configures the Quick Client that can
display parameters (tags values) in table format, as
shown in figure 7.

5. RESULTS
Infilink environment allows creating many
graphical objects attacked to imported tags from OPC
Server. As an OPC client, this application can
communicate with server running on same computer, or
on another one, using network through OPC and
TCP/IP protocols.

Fig. 4. OPC Server device configuration


242 ACTA ELECTROTEHNICA

solution allows energy meter devices integration in


complex monitoring systems (SCADA).

REFERENCES
1. IEC 62056-21, Electricity metering -Data exchange for meter
reading, tariff and load control. Direct local data exchange, First
edition, 2002-05.
2. Drgan, F., Protocoale de comunicaie, UT Press, ISBN978-973-
662-378-3, Cluj-Napoca, 2008.
3. DLMS UA WG Maintenance, Object definition tables, V2.7,
17th July 2013.
4. ***, Actaris, ACE 5000 type 5.1, Three Phase Time Switch
Fig. 8. Infilink software HMI graphic display Static Meter, Technical Document.
5. IEC 62056-53, Electricity metering -Data exchange for meter
reading, tariff and load control. COSEM application layer 2006.
Furthermore displaying de instant value, this 6. ***, Kepware Technologies, KEPServerEX V5 Help, 2014.
application allow display simple trend diagrams of a 7. ***, Kepware Technologies, User-Configurable Driver User
parameter. In a similar manner, it is possible to join Help, 2012.
different OPC based software, such as databases 8. ***, Kessler-Ellis Products, INFILINK HMI Software for
Windows, Users Guide, Revision 4.04, 2012.
historical journals, or alarms and events applications

AKNOWLEDGEMENT

6. CONCLUSIONS The authors are members of the Department of


Electrical Measurements, Faculty of Electrical
The paper proposes a solution to connect and
Engineering from the Technical University of Cluj-
acquire energy meter devices parameters information,
Napoca. Theirs area of interest and researches are
based on IEC 62056-21 mode D communication
Electrical Data Acquisition and Monitoring Systems.
protocol, by using optical serial port adapter and a
Theirs aim are to develop electrical or non electrical
computer running OPC Client/Server environment. The
measurements and remote control applications

You might also like