IEC 61850 Intelligent Electronic Device Configuration Tool
IEC 61850 Intelligent Electronic Device Configuration Tool
IEC 61850 Intelligent Electronic Device Configuration Tool
VAASAN AMMATTIKORKEAKOULU
UNIVERSITY OF APPLIED SCIENCES
Information Technology
ABSTRACT
The aim of this work was to create a Configured Intelligent Electronic Device De-
scription (CID) editor supporting both IEC 61850 edition 1 and edition 2, based
on a working version of an edition 1 CID editor. The main technologies used to
deliver the work were C++ programming language and Qt framework. This work
was done for Arcteq Ltd.
CONTENTS
ABSTRACT .............................................................................................................2
1 INTRODUCTION ............................................................................................ 7
2 IEC 61850 STANDARD .................................................................................. 8
2.1 Overview ................................................................................................... 8
2.2 Generic Object-Oriented Substation Events Messaging ........................... 9
2.3 System Configuration Description Language ........................................... 9
3 CONFIGURED IED DESCRIPTION FILE .................................................. 12
3.1 Extensible Markup Language (XML) ..................................................... 12
3.2 CID File Structure and Functionalities ................................................... 13
4 REQUIREMENT SPECIFICATION ............................................................. 17
4.1 Add Description to Dataset Editor .......................................................... 17
4.2 Add and Remove Logical Nodes Manually ............................................ 17
4.3 Change Prefix Attributes of Logical Nodes ............................................ 17
4.4 Edit GOOSE Subscription Information .................................................. 17
4.5 Export Logical Nodes Information ......................................................... 17
4.6 Extract Data from ICD Files ................................................................... 18
4.7 Set Maximum Client for Report Control Nodes ..................................... 18
4.8 Store GOOSE Subscription Information ................................................ 18
5 CODE BASE ASSESSMENT ....................................................................... 22
6 IMPLEMENTATION .................................................................................... 24
6.1 Refactor ................................................................................................... 24
6.2 Implement New Features ........................................................................ 27
6.2.1 Row-focused Table View ............................................................ 27
6.2.2 Extract Data from ICD Files ....................................................... 28
6.2.3 Add Description to Dataset Editor .............................................. 29
6.2.4 Edit Logical Nodes ...................................................................... 30
6.2.5 Set Maximum Client for Report Control Nodes ......................... 31
6.2.6 Export Logical Nodes Information ............................................. 32
6.2.7 Edit GOOSE Subscription Information ...................................... 32
7 RESULT ......................................................................................................... 34
4
Device
Mechanism or piece of equipment designed to serve a purpose or perform a func-
tion, for example, breaker, relay, or substation computer
IDE
Integrated Development Environment
IEC
International Electrotechnical Commission
Relay
Digital protective relay - a computer-based system with software-based protection
algorithms for the detection of electrical faults
Substation
Electrical substations - the interface between the distribution grid and transmis-
sion systems
STL
Standard library (C++)
7
1 INTRODUCTION
The work in this thesis was done for Arcteq Ltd. The company designs, manufac-
tures, sells, and supports protection relays and arc flash protection systems for elec-
trical utility, power generation, industrial, offshore, marine, institutional, and com-
mercial users /1/. Many of Arcteq’s products support a wide range of communica-
tion protocols including, but not limited to, Modbus, IEC 60870-5-103/101/104,
IEC 61850 and DNP3.
Arcteq’s protection relays were compliant with IEC 61850 edition 1 and the com-
pany has already got an IED configuration tool for edition 1. Since edition 2 of the
standard was evaluated to be mature and can be deployed, an IED configuration
tool capable of handling both edition 1 and edition 2 was needed. The objective of
this work is to fulfil that need.
8
2.1 Overview
IEC 61850 is an important international standard for substation automation that has
a very significant impact on how electric power systems are designed and built. IEC
61850 is a part of the IEC’s Technical Committee 57 architecture for electric power
systems /2/. Being the first standardized communication protocol in substation au-
tomation systems, one of the its main objectives is supporting interoperations
among substation automation devices of different vendors. The standard is based
on Ethernet communication, ensuring high communication bandwidth and speed
while reliability is ensured by utilizing redundancy network protocols such as Par-
allel Redundancy Protocol (PRP).
The standard defines a unified information model with a naming hierarchy and spe-
cific data structures to be used in any compliant device in order to reduce the cost
in engineering time and to improve maintenance tasks. Vendors are requested to
identify the same concepts with the same names, and they must use a common for-
mat to build their information. The hierarchical information model contains the fol-
lowing levels: IED, logical device, logical node, data object, data attribute, basic
type. The relationships of the levels are described in Figure 1 /3/.
The logical devices are logical containers used to organize the information of an
IED, splitting it into different categories. The logical nodes are the functions or the
components that automate the system. There are functions related to control, pro-
tection, measurement, supervision and more. They are identified by four letters; the
first one indicates their category. The table of all categories are defined in IEC
61850-7-4. Each logical node includes a set of mandatory and optional data objects
to fulfil their tasks. The data objects can represent status information, measure-
ments, set points, controllable points, or descriptive information. Each logical node
includes a table in the standard with its related data indicating their name and type.
The vendors must select the ones that they can provide and publish in their IEC
61850 model. /4/
The configuration process is done through multiple steps. First, ICD files shall be
provided by the substation’s vendor. It is a template containing the description of
an IED type capabilities and not containing the communication configuration. After
that, using the ICD files, an SCD file is created using the system configuration tool.
The SCD file, containing all substations’ description and communication configu-
ration, can then be import to the IED configuration tool to extract the information
specific to one substation and store those in a CID file. Finally, the CID file may be
sent from the IED configuration tool to an IED to configure it.
Instead of creating an SCD file, it is also possible to use an ICD file to produce a
CID file, which is what Arcteq’s IED configuration tool has been doing in practice.
11
The IID file becomes handy when there is a change to be made in one configured
substation in the SCD file. While it can be done using the ICD file, the user will
have to re-configure all the communication section. An IID file, on the other hand,
is a CID file with needed modifications, which can then be imported to the system
configuration tool to modify the SCD file.
The SSD and SED files are not relevant to an IED configuration tool. An SSD file
describes the single line diagram of the substation and the required logical nodes.
An SED file describes the interfaces of one project to be used by the other project,
and at reimport the additionally engineered interface connections between the pro-
jects. /7/
12
A CID file is a type of SCL file, whose format is based on XML version 1. There-
fore, it is necessary to understand an XML file structure.
An XML file consists of nodes. For the purpose of this document, three types of
nodes are of concern: element nodes, attribute nodes, and text nodes. An element
node may have attributes (attribute nodes) and a context (text node). For example,
the following line can be an XML node.
<Duck canFly=”true”>Quack</Duck>
It is an element node named “Duck” with an attribute named “canFly” having value
“true”. Its context is a text node with value “Quack”. An XML node may also have
a parent node (a node that contains this node) and child nodes (nodes that this node
contains). The nodes that share one same parent are called siblings. One special
case is the top-level element node called root node. It must have no parent and no
sibling.
Based on the structure defined by the schema, the following XML content is well-
formed and valid:
<chair theme=”Royal”>
<colour>Yellow</colour>
<material>Gold</material>
</chair>
A CID file shall contain a root node named “SCL”, which may consist of the fol-
lowing child nodes: header, substation, communication, IED and data type tem-
plates. The descriptions of the elements are listed in Table 1.
14
Element Description
Header Contains the identification of a CID file and its version
Substation Describes a substation’s functional structure related to
the configured IED
Communication Describes which access points of an IED are connected
to a subnetwork
IED Describes an IED’s configuration
Data type templates Contains templates of the data of elements
Attribute Description
prefix The logical node’s prefix
lnClass The logical node class defined by the standard
lnType The logical node’s type
inst The instance number of this node
desc Description text
The combination of prefix, lnClass, and inst attributes must be unique for every
logical node. There shall be a LNodeType element in the data type templates that
defines the content of each logical node. The logical node type template is built
from data object elements, each of which has a DOType element defining its con-
tent. A data object type template is built from data attribute elements, which can
either have a basic type, be an enumeration, or a structure of a DAType. The
DAType is built from BDA elements, defining the structure elements, which again
can be BDA elements or have a base type such as a DA /7/. An example of the
structure is shown in Figure 3.
15
Some of the nodes in Figure 3 are collapsed to shorten the content. The logical node
and the logical node template are connected by the same values in the logical node’s
lnType attribute and the template’s id attribute. Each instantiated data object (DOI)
is based on the data object in the template. The similar logic is used for data objects
and instantiated data attributes (DAIs).
Apart from DOIs, any logical node may also contain dataset nodes and report con-
trol nodes. Dataset nodes are made up of one or more functionally constraint data
attributes (FCDA). They are used to access many attributes with only one request.
An FCDA may have the attributes stated in Table 3.
Attribute Description
ldInst Name of the logical device
prefix Prefix of the logical node
lnClass Class of the logical node
lnInst Instance number of the logical node
doName Name of the data object
daName Name of the data attribute
fc Functional constraint
Report control nodes are used to configured reporting of events from the server
without the client having to explicitly request for it. A report control node is always
associated with a dataset node in the same logical node.
There is always a special logical node in the IED node, called logical node zero
(LN0). It is used for functions related to the logical device. It may contain GSE
control nodes to store the configuration of GOOSE messaging.
17
4 REQUIREMENT SPECIFICATION
This chapter states the changes required from the edition 1 IED configuration tool.
From this point forward, the edition 1 IED configuration tool provided by Arcteq
will be regarded as the old tool, as opposed to the new tool – the result of this work.
In the old tool, the interface for the users to edit the dataset shows only the prefixes
and types of the logical nodes, making it difficult for the users to use. The new tool
shall also show the description of the logical node.
In the old tool, logical nodes are added and removed automatically. It is done based
on whether the logical node has any data that is in a dataset. The new tool shall
support adding and removing logical nodes manually.
The users shall be able to change the value of the prefix attribute of a logical node.
The prefix values of the logical nodes shall be unique. The prefix value “GS” is
reserved. The users shall not be allowed to change the prefix from and to that value.
The old tool had no support for this feature.
In the old tool, the users can import GOOSE dataset information, but are not able
to edit the information. The new tool shall support both importing and editing of
the information.
The users shall be able to generate documentation of the logical nodes and their
data. The old tool had no support for this feature. The documentation should be a
tab delimited text file. Each line of the file corresponds to a data object of a logical
node. Each line shall contain (in the listing order):
18
In the old tool, the logical nodes and FCDAs that a CID file can have are stored in
an XML file and a text file. Those data are now covered by ICD files. The new tool
shall be able to extract the same information from the provided ICD files.
In edition 1, each report control node serves one client only. When the maximum
number of clients is set in the old tool, that number of report control nodes are
written to the CID file. In edition 2, the report control node has a child node with a
“max” attribute to store the maximum number of clients. Therefore, only one report
control node is added. The child node is described below.
<ReportControl …>
…
<RptEnabled max="1"/>
</ReportControl>
The new tool shall detect the current edition and generate the content accordingly.
<LN …>
<DOI desc="Single point status" name="Ind1">
<DAI name="stVal">
<Private type="SystemCorp_Generic">
<SystemCorp_Generic:GenericPrivateObject …/>
</Private>
</DAI>
</DOI>
</LN>
Attribute Value
prefix “GS”
lnClass “GGIO”
lnType “GGIO_0”
inst Range from 1 to 64, no duplicate
desc “Generic process I/O”
20
The attributes of the general private object node are described in Table 5.
Attribute Description
xmlns Defines the namespace for the prefix. The value is always
“http://www.systemcorp.com.au/61850/SCL/Generic”
Field1 A unique application identification stored in the Communication
element of the publisher’s CID file.
Field2 The configuration revision stored in the GSE control element
Field3 The index of the data in the dataset, starting from 0
Field4 “1” if the next subscribed data is the quality indicator of this
data, “0” otherwise.
Field5 Indicates the data type. “0” for Boolean values, “1” for integers,
“2” for unsigned integers, “3” for floating point values.
One logical node shall be added for each data imported. However, if the next sub-
scribed data is the quality indicator of the previous one, only one logical node is
added. In that case, the data object node will have another data attribute:
<DAI name="q">
<Private type="SystemCorp_Generic">
<SystemCorp_Generic:GenericPrivateObject …/>
</Private>
</DAI>
The general private object node of this data attribute shares the same attributes de-
scribed in Table 5.
21
<LN0 …>
<Inputs>
<ExtRef …/>
…
</Inputs>
…
</LN0>
Attribute Description
iedName Name of the publisher’s IED
ldInst Name of the publisher’s logical device
prefix Prefix of the publisher’s logical node
lnClass Class of the publisher’s logical node
lnInst Instance number of the publisher’s logical node
doName Name of the publisher’s data object
daName Name of the publisher’s data attribute
intAddr Reference to the data attribute of the added logical node
in the subscriber’s CID file
Despite being a tool in released state, the old tool still suffered from minor undis-
covered faults. After one week of faults fixing and refactoring, the code base was
evaluated to be inconsistent, error-prone, and able to benefit from a complete re-
vamp.
The class diagram of the old tool is shown in Figure 4. The class IEC61850Dialog
is the main dialog. The class kept lists of XML nodes, tree items, attributes, attribute
values, nodes’ tag names, nodes’ (context) values. Those lists were always “syn-
chronized” so that the nth element in one list is related to the nth elements in other
lists. This design created considerable amount of maintenance work to keep the lists
in the right order. It was also time-inefficient when finding and removing nodes.
Another aspect worth considering is handling the CID file. In the old tool, the CID
file was read from and written to inside the main class, lengthening the source file
significantly. In addition to the design problems, there was an inconvenience related
to the Qt framework. The class QDomNodeList is designed without iterators, mak-
ing it impossible to utilize any standard library (STL) algorithm. The mentioned
problems shall be fixed before adding any new feature to the tool.
23
6 IMPLEMENTATION
This chapter covers the design of the program and the methods used to fulfil the
requirements above. The old tool was developed using C++ and Qt framework ver-
sion 5.9.0. Hence, the new tool was developed using the same tools.
6.1 Refactor
In order to give more contexts to datum, especially the frequently used XML nodes,
more classes were made as shown in Figure 5. Most of the classes were for storing
data and providing comparison, conversion, and sorting functionalities.
Next, three more classes were created – CidFile, CidReader and CidWriter,
separating the code interacting with the CID file from the main dialog. The classes
relationship is shown in Figure 6.
The three CID file handling classes should remove the need of keeping lists of at-
tributes, tags, and context values in the main class. However, the XML nodes list
and tree items list were still necessary to update the underlying nodes when the tree
items’ values change and vice versa. Hence, to make the searching operation more
time efficient, QHash was used. It is a template class providing a hash-table-based
dictionary. It is implemented so that if the key lookup operation is used multiple
times, the average complexity is O(1) /8/. One requirement of using QHash is to
provide a global function called qHash() for the key type, which must return dif-
ferent values for different keys. The Qt framework already provided this function
for many of its classes but QDomNode, which is reasonable since there can be two
identical nodes in an XML file. However, given the structure of a CID file, it is not
possible for two nodes to share the same parent and have identical attributes. In that
case, it is straight-forward to create a unique string for each node by combining the
node’s absolute path from the root node with its attributes and attributes’ values.
Notice that the hash cannot be changed after the key is added to the container.
Therefore, it should be updated whenever the node object has its attributes’ values
changed, or the attributes that can be changed should not be added to the hash string
at all. In this work, the latter option was chosen since there were not many changing
attributes and removing those would not affect the unicity of the nodes.
27
In the tool, the data was shown as rows in table objects. In order to maintain the
uniformity of the look and behavior of the tables, a class structure was introduced,
as shown in Figure 7.
The item delegate’s functionalities were separated into elementary classes: Spin-
BoxItemDelegate, DeleteButtonDelegate, HoverRowDelegate and Hor-
izontalGridDelegate, all of which inherits from QStyledItemDelegate.
28
The idea was that if any delegate class need a combination of functionalities, it can
just have the necessary elementary classes as its members.
• setItemDelegate(RowFocusItemDelegate *)
connecting the mouse tracking signals from the table view to the handling function
in the delegate. As a result, the following functions inheriting from QTableView
were rendered obsolete and were marked deleted:
• setItemDelegate(QAbstractItemDelegate *)
• setItemDelegateForColumn(int, QAbstractItemDelegate *)
• setItemDelegateForRow(int, QAbstractItemDelegate *)
To facilitate finding the type nodes, the LNodeType, DOType and DAType nodes
were stored as vectors in the class CidFile right after the document was loaded.
The vectors were sorted so that a node can be found faster using
std::lower_bound(). The functions to extract the FCDAs’ data were imple-
mented in the CidReader class as shown in Figure 8.
29
When extracting FCDAs from the opening CID file, the descriptions of the logical
nodes are also collected and stored in the FCDA object as shown in Figure 5 (alt-
hough not needed in the actual FCDA nodes). This will allow the descriptions of
the logical nodes to be shown in the editor as required.
30
To determine which nodes are chosen, each logical node in the ICD file must match
exactly one logical node in the opening CID file. Since the prefix attributes of log-
ical nodes are editable (see requirement 4.3), the unicity of the combination of pre-
fix, lnClass, and inst attributes defined by the standard cannot be used. Instead, the
new tool uses the combination of lnClass, lnType, inst, and desc attributes, which
is unique in Arcteq’s ICD file. Any future changes that affect the unicity of the used
combination will require changes in the implementation of this feature.
After the dialog is accepted, there are two vectors of logical nodes: one contains the
newly selected nodes obtained through the dialog, another one contains the previ-
ously selected nodes in the CID file. The two vectors are then compared using
std::set_difference() to obtain the nodes to be added and the nodes to be
deleted. Note that the function only works with sorted ranges.
Implementing the editable prefix attribute feature was quite straight-forward. Since
the specification was already detailed to logical nodes, the program was hard coded
to set the value items of those attributes to be editable. The validation of the inputted
prefix is done after the data is changed in the item model. If the inputted prefix
already exists or is the same with the reserved prefix, it is reset to the value before
changing. The old value is stored beforehand by implementing an item model class
inheriting from QStandardItemModel. The function setData() was overridden
to emit a dataAboutToChange() signal before setting the data.
31
Since the FCDAs for the datasets are stored inside logical nodes, when the logical
nodes are changed, the following lists may have to be updated:
Since all the information required to be exported can be found in the class FCDA,
the vector of all FCDA objects – the “master” vector – were used as a starting point.
The vector was sorted by the combination of prefix, lnClass, lnInst, and doName
attributes in the listing order to group all data attributes under the same data object
together. The function std::unique_copy() was then used on the sorted vector
to get a new vector containing one FCDA from each data object – the “unique”
vector.
From there, the work was straight-forward. For each element in the “unique” vector,
find all elements in the “master” vector that are in the same data object and create
one entry in the output file. To accelerate the search, std::lower_bound() and
std::upper_bound() were used and the matched elements were erased right af-
ter the information extraction was done.
To support editing GOOSE subscription information, two more classes were intro-
duced: GooseDialog and GoosePublisherDialog. The class GooseDialog
was designed to show the GOOSE configuration in the opening CID file. It holds a
map connecting GOOSE input numbers (integers range from 1 to 64) to objects of
type GooseSetting. The GOOSE configuration to be imported from another CID
file (the publisher) should be shown in an object of type GoosePublisher-
Dialog. Both classes contain a RowFocusTableView object as the item view,
paired with an item delegate of type GooseItemDelegate (described in Figure
7), allowing the user to delete any row using the button placed at the end of each
row and change the GOOSE input number using a spin box widget. The interfaces
and relationship of the classes are shown in Figure 10.
33
When a CID file is opened, the subscription information is processed and displayed
in the GooseDialog object. The user will be given a warning when changing the
GOOSE input number to an existing one, and the input number will be changed
back to the previous value. A file dialog will be shown when the import button is
pressed. After the publisher’s CID file is chosen, the publishing datum are displayed
in the GoosePublisherDialog object for editing before being added. The pro-
gram assigns an input number to each entry automatically by finding the smallest
input number that has not been taken. If all input number have been taken, the input
number will be -1, and will not be added to the opening CID file when the
GoosePublisherDialog is accepted.
34
7 RESULT
Figure 11 and 9 show the main dialog of the old tool and the new tool.
The main visible differences are three more buttons in the tool bar, the attribute
view, and the logical nodes’ texts. The attribute view in the new tool displays the
attributes vertically instead of horizontally. The logical nodes’ texts are more de-
scriptive, and coloured green since they contain editable attributes. The added but-
tons are for exporting logical nodes information, editing logical nodes, and indicat-
ing edition. The edition indicating button currently does not respond to presses from
the user since the edition switching feature has not been supported.
The class RowFocusTableView was used with the default item delegate (RowFo-
cusItemDelegate) to present the data. The implementation worked as intended
with no vertical grid and row highlighting on mouse hover.
36
The dialogs displaying GOOSE subscription and publishing information are shown
in Figure 14 and Figure 15.
Since an item delegate of type GooseItemDelegate was used, the user can de-
lete entries and edit GOOSE input numbers. The entries in the publishing dialog
are assigned input numbers that have not been taken as expected. The resulting
CID file structure after an entry is added to the subscription dialog is shown in
Figure 16.
8 TESTING
All unit tests and integration tests were done after a function or group of functions
were implemented by observing outputs for different inputs. No testing framework
was used.
After the work had been implemented, system testing was done by comparing the
output file (CID file or text file) from the new tool with the desired outcome. The
comparison was made for each of the following actions:
To facilitate the comparing process, a program called Oxygen XML Developer 22.0
developed by Syncro Soft SRL was used. The input and desired output files were
provided by the customer. Additionally, the features inherited from the old tool
were also tested to ensure their serviceability.
After all system tests have passed, the output CID files from the new tool were used
to configure actual protection relays. This work was done by the customer.
38
This chapter covers the assessment of the phases of the project, possible future de-
velopments of the work, and the conclusion made.
The project was done over the time span of about 260 hours, of which:
The time allocation was reasonable for a small-sized project. The final implemen-
tation of the configuration tool was fully functional and met the requirements stated
by the customer. The tools used in the project were mainly an IDE for Qt project
development and a private Git server provided by the customer. All the tests were
done without utilizing any testing tool or framework, which was something to be
improved.
9.2 Continuation
Future developments can be focusing to three aspects: improving the opening time,
supporting edition switch, and utilizing logical nodes’ contents to identity logical
nodes.
The opening time for the largest CID file provided (the ICD file) was measured to
be approximately 3 seconds. The time was used mostly in the process of getting all
FCDA information and creating the tree items to display those data .While it is not
too big a problem, lessening that time will increase the efficiency of the configura-
tion tool.
Supporting edition switch would greatly facilitate the use of the configuration tool.
The edition switch interface was already made, but since the feature was out of
scope, it was never implemented.
39
The ability to identify a logical node by a private node inside of it was known very
late in the testing phase, and the implementation was evaluated to be difficult.
Therefore, it was not utilized in the final version of the tool. If it were in used, the
identification of logical nodes would be based on a well-defined rule instead of an
observed implicit rule of the CID file (see 6.2.4). In addition, more attributes of the
logical nodes will be able to be changed.
9.3 Conclusion
The project presented all the needed works to upgrade an IED configuration tool
from supporting only edition 1 to supporting both edition 1 and edition 2 of the IEC
61850 standard, covering code base refactoring, implementing new features and
possible future developments. As long as the IEC 61850 standard is still in used,
this project can serve as a reference for all vendors to work on similar problems.
40
10 REFERENCES
/2/ Mackiewicz, R. 2006. Overview of IEC 61850 and benefits. IEEE PES
Power Systems Conference and Exposition October 29 – November 1, 2006. Mon-
treal, Quebec.
/3/ IEC TR 61850-1:2013. IEC 61850 technical report. Edition 2.0. 2013. 73
pages.
/5/ Energy software and testing. Introduction to IEC 61850 protocol. Accessed
06.05.2020. https://www.ensotest.com/iec-61850/introduction-to-iec-61850-proto-
col/
/7/ IEC 61850-6:2009. IEC 61850. Edition 2.0. 2009. 436 pages.