Sys600 Opc Server
Sys600 Opc Server
3
OPC Server
1MRS756659 MicroSCADA Pro SYS 600 9.3
Issued: 31.03.2010 OPC Server
Version: B/31.12.2010
Technical Description
OPC Server
Technical Description
4
1MRS756659 MicroSCADA Pro SYS 600 9.3
OPC Server
Technical Description
1.1. Copyrights
The information in this document is subject to change without notice and should not
be construed as a commitment by ABB Oy. ABB Oy assumes no responsibility for
any errors that may appear in this document.
In no event shall ABB Oy be liable for direct, indirect, special, incidental or
consequential damages of any nature or kind arising from the use of this document,
nor shall ABB Oy be liable for incidental or consequential damages arising from
use of any software or hardware described in this document.
This document and parts thereof must not be reproduced or copied without written
permission from ABB Oy, and the contents thereof must not be imparted to a third
party nor used for any unauthorized purpose.
The software or hardware described in this document is furnished under a license
and may be used, copied, or disclosed only in accordance with the terms of such
license.
Copyright © 2010 ABB Oy
All rights reserved.
1.2. Trademarks
Registrations and trademarks used in this document include:
Windows: Registered trademark of Microsoft Corporation.
1.3. General
This manual provides information for application programmers that build up OPC
(OLE for Process Control) client applications interacting with SYS 600.
The SYS 600 system contains three different OPC (OLE for Process Control) server
implementations based on the specifications of OPC Foundation. The documents
containing these specifications are listed below in Section 1.4.
The three OPC servers are the following:
1. Data Access Server is an implementation of OPC Data Access Custom Interface
Standard. It exposes all the data in the SYS 600 database to its clients. There is a
single instance of the server, which runs as an integrated process within the
SYS 600 base system. This server is described in Chapter 2.
2. Alarms and Events Server is an implementation of OPC Alarms and Events
Custom Interface Standard. It sends notifications of significant events to its
clients. Each SYS 600 application runs its own instance of the server as an
integrated process within the SYS 600 base system. This server is described in
Chapter 3.
3. Application OPC Server is an implementation of OPC Data Access Custom
Interface Standard. It is a tunneling server that is usually run in the computer
where the client application runs. It exposes the data of the connected Data
Access Server to the client(s). The Application OPC Server is used in redundant
(HSB) SYS 600 systems. It supervises the state of an application in the
5
SYS 600 9.3 MicroSCADA Pro 1MRS756659
OPC Server
Technical Description
The SYS 600 OPC Server implementation is based on the following documents by
OPC Foundation:
6
1MRS756659 MicroSCADA Pro SYS 600 9.3
OPC Server
Technical Description
2.1. General
The SYS 600 OPC Data Access Server is an implementation of the interface
specification OPC Data Access Custom Interface Standard, Version 2.05A, on the
SYS 600 system.
The main features of the Data Access Server include the following:
• All the objects of the SYS 600 database are exposed by the server as OPC items.
See Section 2.2.
• All the attributes of the SYS 600 objects are exposed by the server as OPC items
and as OPC item properties. See Section 2.3.
• The server implements three item name spaces for the different needs of different
client applications. See Section 2.2.
• The server supports the dynamic object space of SYS 600 by implementing a few
special purpose items that the client applications may use to keep track of newly
created and deleted objects. See Section 2.5.
• The whole functionality that the SYS 600 implementation language SCIL offers
for reading and writing objects (evaluating object attributes, commands #SET
and #MODIFY) is also available by reading and writing OPC items. See Section
2.6.9.
• The full power of the SCIL language is reached by client applications via some
special purpose OPC items. See Section 2.5.
• The server is capable of delivering all the changes of an item to the client
applications by implementing true update rate 0 OPC item groups. See Section
2.4.
• A great effort has been put on the consistency of the data that is seen by the client
applications. See Sections 2.6.9 and 2.6.11.
• The updating of the values of OPC items is highly optimized for fast access and
low overhead. See Section 2.4.
• The server fully supports multilingual SYS 600 applications. See Section 2.6.1.
• The server is fully integrated to the SYS 600 base system software. It is started
and stopped by the SYS 600 application.
This chapter provides information for application programmers that build up OPC
data access client applications interacting with SYS 600.
7
SYS 600 9.3 MicroSCADA Pro 1MRS756659
OPC Server
Technical Description
3. The user defined name space offers an alternative view to the SYS 600 objects
and their attributes. The hierarchy of the name space, as well as the item names
are defined by the application engineering.
8
1MRS756659 MicroSCADA Pro SYS 600 9.3
OPC Server
Technical Description
Two of the highest level item branches have been opened to show that there are three
applications and four stations defined in the system.
The fully qualified OPC item ID begins with two backslashes (\\) to indicate that it
is an absolute name space item ID. The branch item names that make up the path to
the item are separated by a single backslash.
Some examples of a valid absolute item ID’s are listed below:
\\SYS The base system object SYS:B
\\STA\3 The base system object STA3:B
\\APL\1 The base system object APL1:B
\\APL\1\P\ABC\1 The process object ABC:1P1
The ‘Windows style’ naming of absolute name space items (instead of the
conventional naming with dot separated names often seen in OPC servers) is
selected for three reasons:
• The dot separated names are reserved for the user defined name space.
• A dot is a valid character in SYS 600 object names. Depending on the application
engineering, it may or may not imply a hierarchy.
• The prefix ‘\\’ of the absolute name space item ID’s makes a distinction between
the absolute and application relative item ID’s.
The application branches that refer to a HOT application (in Fig. 2.2.1.-1, the branch
\\APL\1) open further to expose the application data bases. They are described in the
next section in more detail. As seen in the example above (\\APL\1\P\ABC\1), the
application objects may be accessed by absolute name space item ID’s as well.
9
SYS 600 9.3 MicroSCADA Pro 1MRS756659
OPC Server
Technical Description
10
1MRS756659 MicroSCADA Pro SYS 600 9.3
OPC Server
Technical Description
The last two items seen in Fig. 2.2.2.-1, the NAMESPACE and the
OPC NAMESPACE item, are special purpose OPC items used to report the changes
in the name space, see Section 2.5.
The fully qualified OPC item ID begins with a backslash (\) to indicate that it is an
application relative item ID. The branch item names that make up the path to the
item are separated by a single backslash.
Some examples of valid application relative item ID’s are listed below:
\ The application itself, i.e. APLn:B, where n is the primary
application
\P\ABC\1 The process object ABC:P1
\D\ABC The data object ABC:D
All the application relative item ID’s may also be given as absolute item ID’s. For
example, if the application 1 is the primary application, the item ID’s \P\ABC\1 and
\\APL\1\P\ABC\1 denote the same SYS 600 object.
If you want to create an OPC item ID for an object that is not located in the primary
application, a fully qualified absolute item ID must be used.
The top level branches of the application relative name space may be opened further
to list the object names, as seen in Fig. 2.2.2.-2.
11
SYS 600 9.3 MicroSCADA Pro 1MRS756659
OPC Server
Technical Description
12
1MRS756659 MicroSCADA Pro SYS 600 9.3
OPC Server
Technical Description
13
SYS 600 9.3 MicroSCADA Pro 1MRS756659
OPC Server
Technical Description
The same object is reached by using the other two name spaces:
\\APL\1\OPC\Tipperary.Feeder 1.Breaker.Position
\OPC\Tipperary.Feeder 1.Breaker.Position
2.3.1. Overview
The SYS 600 OPC Data Access Server supports the OPC defined standard
properties 1 - 6 for every OPC item.
Items that correspond to SYS 600 database objects have additional, vendor specific
properties as shown in Fig. 2.3.1.-1. These properties match exactly the SCIL
attributes of the object.
Some items in the SYS 600 item name space are neither readable nor writeable
(because they have no ‘object value’), but still have a set of properties. All the items
that correspond to the base system objects of SYS 600 are examples of such items
(\\SYS, \\APL\1 etc.).
In summary, all the attributes of all the SYS 600 objects, except for system (S type)
objects, can be accessed as item properties via the Data Access Server. The attributes
of the S type objects are totally managed by the PC-NET program; they are not
known by the OPC server (or the SYS 600 base system).
14
1MRS756659 MicroSCADA Pro SYS 600 9.3
OPC Server
Technical Description
Item Properties
15
SYS 600 9.3 MicroSCADA Pro 1MRS756659
OPC Server
Technical Description
16
1MRS756659 MicroSCADA Pro SYS 600 9.3
OPC Server
Technical Description
Update rate 0
By implementing the REPORT policy, the Data Access Server may offer true update
rate 0 groups, that are not often seen in other OPC servers. If the update rate of a
group is set to 0, the server implementation guarantees that all the changes of the
items in the group will be seen by the client, i.e. no events are lost.
However, the clients should use update rate 0 groups carefully. The traffic between
the server and the client may increase drastically when rapidly changing items are
added to the group. For example, it normally makes no sense to subscribe to all the
changes of rapidly fluctuating analog input objects.
Polled items
The Data Access Server implementation prefers the REPORT policy when it selects
the update policy of different items. As a matter of fact, almost all the items obey the
REPORT policy.
The items that are implemented to use the POLL update policy are the following:
• The special purpose SCIL language items SCIL and SCIL PROGRAM, see
Section 2.5.2.
• The system object items (the ones located in the S branch of a SYS 600
application), i.e. the items that are managed by the PC-NET program.
• The items that refer to an index or an index range of a SYS 600 object attribute,
for example \:SV4 (the system variable 4 of the primary application) or
17
SYS 600 9.3 MicroSCADA Pro 1MRS756659
OPC Server
Technical Description
Overview
This section describes the data types used by the SYS 600 OPC Data Access Server.
The conversion rules between the SCIL data types and the OLE data types are
summarized in Table 2.4.2-1 below.
18
1MRS756659 MicroSCADA Pro SYS 600 9.3
OPC Server
Technical Description
Table 2.4.2-1 Conversion rules between SCIL and OLE data types
Also accepted when written
SCIL Data Type OLE Native Data Type
or subscribed
Vectors
For vectors of simple data types, see ‘Simple data types’ above.
19
SYS 600 9.3 MicroSCADA Pro 1MRS756659
OPC Server
Technical Description
The vectors of non-simple data types (as well as vectors of mixed data types) are
represented as arrays of VT_VARIANT. Each element VARIANT may then be of
different OLE data type.
There is no support in OLE for passing the status codes of vector elements to the
client. The elements with status codes from 1 to 9 (“almost OK values”) are passed
as good values. The elements with a status code 10 or higher are considered as
missing, they are converted to OLE data type VT_EMPTY.
The indexing of OLE arrays starts from 1 as in SCIL. For every OLE array passed
to the client, the SafeArrayGetLBound function of OLE returns the value 1.
Lists
OLE does not support any data type that corresponds to the LIST type of SCIL.
An artificial mapping is implemented: a list is represented as a VARIANT array,
where the element VARIANT’s are as follows:
1. Type VT_CY, value 0. This works as a flag to tell that a list value follows.
VT_CY (currency) is not otherwise used, therefore it can be used as a flag.
2. Type VT_BSTR, the name of the first attribute.
3. The value of the first attribute, data type according to Table 2.4.2-1.
4. VT_BSTR, the name of the second attribute.
5. The value of the second attribute.
6. And so on.
Example
The SCIL data structure
LIST(A = 1, B = VECTOR(1, 2.5), C = LIST(D = FALSE))
is represented as an OLE array of 7 VARIANT type elements described in the table
below.
1 VT_CY 0
2 VT_BSTR “A”
3 VT_I4 1
4 VT_BSTR “B”
5 VT_ARRAY | array 1 VT_I4 1
VT_VARIANT
2 VT_R4 2.5
6 VT_BSTR “C”
20
1MRS756659 MicroSCADA Pro SYS 600 9.3
OPC Server
Technical Description
21
SYS 600 9.3 MicroSCADA Pro 1MRS756659
OPC Server
Technical Description
AL Alarm
AM Alarm Milliseconds
AQ Alarm Qualified Time
AS Alarm State
AT Alarm Time
AZ Alarm Zone
BL Blocked
EP End of Period
MM Minimum Time Milliseconds
MQ Minimum Qualified Time
MT Minimum Time
OF Overflow
OR Out of Range
OS Object Status
RA Reserved A
RB Reserved B
RM Registration Milliseconds
RQ Registration Qualified Time
RT Registration Time
SB Substituted
SE Selection
SP Stop Execution
SU Substitution State
SX State Text
TS Topological State
WQ Warning Qualified Time
XM Maximum Time Milliseconds
XQ Maximum Qualified Time
XT Maximum Time
YM Alarm On Time Milliseconds
YQ Alarm On Qualified Time
YT Alarm On Time
AK, CK, CM, CN, CQ, ID, NS, OQ, QU, OPC Event (OE) object attributes
SE, SN, VC, VM, VQ and VT
LE, LP, LV, LX, ND and NF Network Topology (NT) object attributes
2.4.4. Quality
Process objects
22
1MRS756659 MicroSCADA Pro SYS 600 9.3
OPC Server
Technical Description
For the process object values, the OPC quality of the item value is determined by the
OS (Object Status) attribute and some other attributes of the object, see Table 2.4.4-
1 below.
Table 2.4.4-1 OPC Quality of process objects
OPC Quality Condition
OPC_QUALITY_GOOD OS = 0 or 3, OR = 0, OF = 0, SB = 0
OPC_QUALITY_SENSOR_FAILURE OS = 1 (FAULTY_VALUE_STATUS)
OPC_QUALITY_LAST_USABLE OS = 2 (OBSOLETE_STATUS)
OPC_QUALITY_UNCERTAIN OS = 4 .. 9
OPC_QUALITY_NOT_CONNECTED OS = 10 (NOT_SAMPLED_STATUS)
OPC_QUALITY_BAD OS > 10
OPC_QUALITY_EGU_EXCEEDED OR (Out of Range) = 1 or
OF (Overflow) = 1
OPC_QUALITY_LOCAL_OVERRIDE SB (Substituted) = 1
Other objects
For data object values, the quality is determined by the SCIL status code contained
in the OS (Object Status) attribute of the object. For all the other OPC items, the
quality is determined by the SCIL status code obtained from the evaluation of the
item, see Table 2.4.4-2.
Table 2.4.4-2 OPC Quality vs. SCIL status code
OPC Quality SCIL Status Code
OPC_QUALITY_GOOD 0 (OK_STATUS) or 3
(FAULTY_TIME_STATUS)
OPC_QUALITY_SUB_NORMAL 1 (SUSPICIOUS_STATUS)
OPC_QUALITY_LAST_USABLE 2 (OBSOLETE_STATUS)
OPC_QUALITY_UNCERTAIN 4 .. 9
OPC_QUALITY_NOT_CONNECTED 10 (NOT_SAMPLED_STATUS)
OPC_QUALITY_BAD > 10
All objects
Status code 3 (FAULTY_TIME_STATUS) is reported as OPC_QUALITY_GOOD
for clients. The status code implies that the value is good but the time stamp may be
inaccurate or bad. In the OPC specification, there is no quality for time stamps.
Therefore, status code 3 is regarded as 0 (OK_STATUS).
Whenever the OPC quality is OPC_QUALITY_BAD (non-specific bad quality), a
vendor specific error code is supplied to give more information about the failure.
23
SYS 600 9.3 MicroSCADA Pro 1MRS756659
OPC Server
Technical Description
• IOPCSyncIO::Read
• IOPCSyncIO::Write
• IOPCAsyncIO2::Read
• IOPCAsyncIO2::Write
• IOPCDataCallback::OnDataChange
• IOPCDataCallback::OnReadComplete
• IOPCDataCallback::OnWriteComplete
Unfortunately, the OPC standard does not allow vendor specific error codes to be
returned by the following functions:
• IOPCItemMgt::AddItems
• IOPCItemMgt::ValidateItems
In case of a failure, these functions are allowed to return only one of the error codes
OPC_E_INVALIDITEMID, OPC_E_UNKNOWNITEMID, OPC_E_BADTYPE
or E_FAIL. Consequently, the server cannot tell the specific reason why the function
failed.
The vendor specific error codes of the SYS 600 OPC Data Access Server are
basically SCIL error codes generated by the SYS 600 base system. According to the
OPC rules, the HRESULT type OPC error code is generated by adding the vendor
error code mask 0xC0048000 to the SCIL error code. If the OPC error code is
0xC0048806, the corresponding SCIL error code is 0x806 = 2054
(PROF_OBJECT_NOT_IN_USE).
The mnemonic name for a vendor specific error code is obtained by
IOPCCommon::GetErrorString or IOPCServer::GetErrorString. As an example,
these functions return the string “PROF_OBJECT_NOT_IN_USE”, when invoked
with the ‘dwError’ parameter value 0xC0048806.
24
1MRS756659 MicroSCADA Pro SYS 600 9.3
OPC Server
Technical Description
Actually, there are several NAMESPACE items in the system, one for the base
system objects and one for each hot application. In addition, each hot application has
an OPC NAMESPACE item.
Fig. 2.5.1.-1 The NAMESPACE item for the base system objects
The item has a text (BSTR) value that tells the latest change in the base system object
name space (or is an empty string). The value begins with a character ‘+’ (created)
or ‘-’ (deleted), followed by the name of the created or deleted OPC item.
For example, the value “+\\STA\23” indicates that the station object \\STA\23 (SCIL
name STA23:B) has been created.
Actually, the base system objects are predefined in the SYS 600: APL1 ... APL250,
STA1 ... STA50000 etc. However, most of them are typically unused in any
practical system.
The Data Access Server considers a base system object to be existing according to
the following attribute values:
• APL (Application) objects: TT (Translation Type) <> “NONE”
• IND (Input Device) objects: TT (Translation Type) <> “NONE”
• LIN (Link) objects: LT (Link Type) <> “NONE”
• MON (Monitor) objects: TT (Translation Type) <> “NONE”
• NOD (Node) objects: LI (Link Number) <> 0
25
SYS 600 9.3 MicroSCADA Pro 1MRS756659
OPC Server
Technical Description
26
1MRS756659 MicroSCADA Pro SYS 600 9.3
OPC Server
Technical Description
The OPC NAMESPACE item has a text (BSTR) value that tells the latest change in
the user defined OPC item name space (or is an empty string). The value begins with
a character ‘+’ (created) or ‘-’ (deleted), followed by the name of the created or
deleted OPC item.
For example, the value “+\\APL\1\OPC\Station1.Feeder2” indicates that the user
defined OPC item name Station1.Feeder2 has been created in the application.
27
SYS 600 9.3 MicroSCADA Pro 1MRS756659
OPC Server
Technical Description
SCIL item
The SCIL item is used to evaluate any SCIL language expression.
The OPC item id is formed by appending the expression to the SCIL item id:
• ‘\\APL\2\SCIL\1 + 2’ evaluates the SCIL expression ‘1 + 2’ in the context of
application 2. It will, of course, always evaluate to the integer value 3.
• ‘\SCIL\APPLICATION_OBJECT_COUNT(0,”D”)’ invokes the
APPLICATION_OBJECT_COUNT function in the primary application and
evaluates to the number of data objects in the application.
The expression may contain any valid SCIL language characters and it may be of
any length, provided that the length of the item id does not exceed 65 535 characters.
SCIL items do not have any canonical (or native) data type, the data type may be
determined only by evaluating the item. The canonical data type returned by
IOPCItemMgt::AddItems and ValidateItems is VT_EMPTY.
28
1MRS756659 MicroSCADA Pro SYS 600 9.3
OPC Server
Technical Description
When a SCIL PROGRAM item is evaluated, the compiled version of the program is
executed. If no execution error is encountered, the value of the item is set to the value
returned by the terminating #return statement of the program, or to an empty value
if there is no such statement. If the execution terminates to an error, the quality of
the item is set to OPC_QUALITY_BAD and the SCIL status code is returned as the
auxiliary error code.
Because of the limited error reporting possibilities, it is recommended that any SCIL
program to be executed via OPC is first thoroughly tested in the native SYS 600
environment.
2.6.1. IOPCCommon
LocaleIDs
The languages listed in Table 2.6.1-1 are returned by the QueryAvailableLocaleIDs
method. This indicates that the locale ids derived from the listed language ids can be
used as an argument for the SetLocaleID method.
However, it is up to the SYS 600 applications which languages are actually
supported. A SYS 600 system can contain several applications, which support
different languages. Therefore, the OPC server must ‘support’ virtually all the
languages. If the chosen language is not supported by the application, language-
sensitive texts are read in English.
29
SYS 600 9.3 MicroSCADA Pro 1MRS756659
OPC Server
Technical Description
The toolkit, that the Data Access Server is based on, supports a few LocaleIDs
(English, German, Russian, Hungarian and Swedish). The OPC error codes returned
by the GetErrorString method are available in these languages.
Table 2.6.1-1 ISO 639 language identifiers and Windows language ids
Afrikaans AF LANG_AFRIKAANS
Albanian SQ LANG_ALBANIAN
Arabic AR LANG_ARABIC
Armenian HY LANG_ARMENIAN
Assamese AS LANG_ASSAMESE
Azerbaijani AZ LANG_AZERI
Basque EU LANG_BASQUE
Byelorussian BE LANG_BELARUSIAN
Bengali BN LANG_BENGALI
Bulgarian BG LANG_BULGARIAN
Catalan CA LANG_CATALAN
Chinese ZH LANG_CHINESE
Croatian HR LANG_CROATIAN
Czech CS LANG_CZECH
Danish DA LANG_DANISH
Dutch NL LANG_DUTCH
English EN LANG_ENGLISH
Estonian ET LANG_ESTONIAN
Faroese FO LANG_FAEROESE
Persian FA LANG_FARSI
Finnish FI LANG_FINNISH
French FR LANG_FRENCH
Georgian KA LANG_GEORGIAN
German DE LANG_GERMAN
Greek EL LANG_GREEK
Gujarati GU LANG_GUJARATI
Hebrew HE LANG_HEBREW
Hindi HI LANG_HINDI
Hungarian HU LANG_HUNGARIAN
Icelandic IS LANG_ICELANDIC
Indonesian ID LANG_INDONESIAN
Italian IT LANG_ITALIAN
Japanese JA LANG_JAPANESE
Kannada KN LANG_KANNADA
Kashmiri KS LANG_KASHMIRI
Kazakh KK LANG_KAZAK
Korean KO LANG_KOREAN
Latvian LV LANG_LATVIAN
Lithuanian LT LANG_LITHUANIAN
Macedonian MK LANG_MACEDONIAN
Malay MS LANG_MALAY
Malayalam ML LANG_MALAYALAM
Marathi MR LANG_MARATHI
Nepali NE LANG_NEPALI
Norwegian NO LANG_NORWEGIAN
30
1MRS756659 MicroSCADA Pro SYS 600 9.3
OPC Server
Technical Description
Table 2.6.1-1 ISO 639 language identifiers and Windows language ids
Oriya OR LANG_ORIYA
Polish PL LANG_POLISH
Portuguese PT LANG_PORTUGUESE
Punjabi PA LANG_PUNJABI
Romanian RO LANG_ROMANIAN
Russian RU LANG_RUSSIAN
Sanskrit SA LANG_SANSKRIT
Serbian SR LANG_SERBIAN
Sindhi SD LANG_SINDHI
Slovak SK LANG_SLOVAK
Slovenian SL LANG_SLOVENIAN
Spanish ES LANG_SPANISH
Swahili SW LANG_SWAHILI
Swedish SV LANG_SWEDISH
Tamil TA LANG_TAMIL
Tatar TT LANG_TATAR
Telugu TE LANG_TELUGU
Thai TH LANG_THAI
Turkish TR LANG_TURKISH
Ukrainian UK LANG_UKRAINIAN
Urdu UR LANG_URDU
Uzbek UZ LANG_UZBEK
Vietnamese VI LANG_VIETNAMESE
Uzbek UZ LANG_UZBEK
Vietnamese VI LANG_VIETNAMESE
IOPCCommon::GetErrorString
The method IOPCCommon::GetErrorString may be used to get a description of
vendor specific (SCIL) error codes. The description is the mnemonic name of the
SCIL status code as returned by the SCIL function STATUS_CODE_NAME.
2.6.2. IOPCServer
IOPCServer::AddGroup
When the ‘dwRequestedUpdateRate’ parameter is set to 0, the server sends all the
changes of the items connected to the group. In this case, only items with the update
policy REPORT may be added to the group, see Section 2.4.1.
The ‘dwLCID’ parameter can be chosen from the Table 2.6.1-1. For more
information on localization, see Section 2.6.1.
IOPCServer::GetErrorString
The method IOPCServer::GetErrorString may be used to get a description of vendor
specific (SCIL) error codes. The description is the mnemonic name of the SCIL
status code as returned by the SCIL function STATUS_CODE_NAME.
31
SYS 600 9.3 MicroSCADA Pro 1MRS756659
OPC Server
Technical Description
2.6.3. IOPCItemProperties
Recommended properties
The recommended properties (property ID’s 100 to 399) are not supported by the
SYS 600 OPC Data Access Server.
IOPCItemProperties:: QueryAvailableProperties
The OPC Data Access Custom Interface Standard 2.05A states:
“The expected use of this is that you would pass it an ITEMID such as A100, which
represents a ‘record’ object although you can also pass it a fully qualified ITEMID
such as A100.CV or A100.SP. In any case, you will get back a list of all of the other
properties related to this item; typically, these are the other properties of the record
object. Except for properties 1 - 6 it is not relevant whether the starting ITEMID
reflects the record object or one of its property objects. Either way you will get back
the same result - i.e. the list of properties in the containing ‘record’ object.”
IOPCItemProperties:: GetItemProperties
Whenever a property cannot be read, the server provides the reason as a vendor
specific error code in the ‘ppErrors’ array.
IOPCItemProperties:: LookupItemIDs
For each vendor specific property (SYS 600 object attribute), the method
LookupItemIDs returns an item id that can be added to a group.
For the standard properties, no item id’s are available.
2.6.4. IOPCServerPublicGroups
This optional interface is not implemented, because public groups are not relevant
in SYS 600.
2.6.5. IOPCBrowseServerAddressSpace
This optional interface is fully implemented. A HIERARCHICAL address space is
shown.
32
1MRS756659 MicroSCADA Pro SYS 600 9.3
OPC Server
Technical Description
IOPCBrowseServerAddressSpace::BrowseOPCItemIDs
IOPCBrowseServerAddressSpace::BrowseAccessPaths
Access paths are not relevant in SYS 600. Therefore, the method
BrowseAccessPaths always return S_FALSE (there is nothing to enumerate).
2.6.6. IPersistFile
This interface is irrelevant in SYS 600, it is not implemented.
2.6.7. IOPCItemMgt
Blobs
Blobs are not used by the SYS 600 OPC Data Access Server.
2.6.8. IOPCGroupStateMgt
IOPCGroupStateMgt::SetState
The ‘pLCID’ parameter can be chosen from the Table 2.6.1-1. For more information
on localization, see Section 2.6.1
33
SYS 600 9.3 MicroSCADA Pro 1MRS756659
OPC Server
Technical Description
34
1MRS756659 MicroSCADA Pro SYS 600 9.3
OPC Server
Technical Description
2.6.11. IOPCDataCallback
IOPCDataCallback::OnDataChange
The server supplies a vendor specific error code (SCIL status code) in the ‘pErrors’
array for any item that has the quality OPC_QUALITY_BAD (unspecified bad
quality).
The consistency of the data as seen by the client is guaranteed. All the items that
have changed due to a single transaction in SYS 600 (such as a process event or a
SCIL command #SET or #MODIFY) are received by the client in one
OnDataChange callback.
As an example, suppose that the client has subscribed to the items \P\ABC\1,
\P\ABC\1:AS and \:AC, i.e. the value and the alarm state of a process object and the
alarm count of the application. If a process event now causes an alarm of the object,
the changed values of all the three items are received in a single OnDataChange
callback.
2.6.12. IAdviseSink
This interface is an obsolete interface defined by the OPC Data Access Custom
Interface Standard, Version 1.0. It is supported by the SYS 600 OPC Data Access
Server, but not as thoroughly tested as the recommended Version 2.0 interface
IOPCDataCallback.
35
SYS 600 9.3 MicroSCADA Pro 1MRS756659
OPC Server
Technical Description
36
1MRS756659 MicroSCADA Pro SYS 600 9.3
OPC Server
Technical Description
3.1. General
The SYS 600 OPC Alarms and Events Server (OAES) is an implementation of the
interface specification OPC Alarms and Events Custom Interface Standard, Version
1.10, on the SYS 600 system.
The main features of the Alarms and Events Server include the following:
• Each SYS 600 application has its own instance of OAES.
• The server is fully integrated to the SYS 600 base system software. It is started
and stopped by the SYS 600 application.
• The name space (event sources, areas, event categories, conditions, etc.) of the
server is configured by application engineering.
• Conditions are associated with SYS 600 process alarms, other events with
SYS 600 process events.
• The server supports multilingual SYS 600 applications. See Section 3.7.7.
This chapter provides information for application programmers that build up OPC
alarms and events (A&E) client applications interacting with SYS 600.
37
SYS 600 9.3 MicroSCADA Pro 1MRS756659
OPC Server
Technical Description
3.5. Conditions
OPC conditions go hand in hand with SYS 600 alarms. Each process object that
generates SYS 600 alarms may have an associated OPC condition defined.
The OPC condition is active while the process object is alarming. The condition is
acknowledged when the alarm of the process object is acknowledged. Conditions
(process alarms) may be acknowledged by OPC clients and/or by conventional SCIL
based tools.
Multiple state conditions are applicable only for the limit alarms and warnings of
analog process objects.
The conditions and their attributes are freely configurable during the application
design phase.
3.6. Events
Each process object may generate a simple or a tracking event when its value is
updated. In addition, changes of several other process object attributes may generate
additional events.
All these events and their attributes are freely configurable by the application.
38
1MRS756659 MicroSCADA Pro SYS 600 9.3
OPC Server
Technical Description
3.7.1. IOPCCommon
The implementation of this interface is the same as in the Data Access Server. See
Section 2.6.1 for details.
3.7.2. IOPCEventServer
All the methods of the interface have been implemented, including the following
optional ones:
• QuerySourceConditions
• TranslateToItemIDs
• GetConditionState
• EnableConditionByArea
• EnableConditionBySource
• DisableConditionByArea
• DisableConditionBySource
• CreateAreaBrowser
IOPCEventServer::AckCondition
The server strictly checks the arguments pftActiveTime and pdwCookie according
to the specification (unlike some other OPC A&E servers). Therefore, the method
returns the error code E_INVALIDARG or OPC_E_INVALIDTIME when these
arguments do not exactly match the corresponding attributes of the condition event
notification.
3.7.3. IOPCEventServer2
This optional interface has not been implemented.
3.7.4. IOPCEventAreaBrowser
This optional interface has been implemented.
3.7.5. IOPCEventSubscriptionMgt
IOPCEventSubscriptionMgt::SetFilter
The OPC specification lists the following five optional filter criteria: event type,
event category, severity, process area and event source. All of them have been
implemented in the Alarms and Events Server.
39
SYS 600 9.3 MicroSCADA Pro 1MRS756659
OPC Server
Technical Description
IOPCEventSubscriptionMgt::SelectReturnedAttributes
The Alarms and Events Server supports one vendor specific attribute, CV (for
‘current value’) for all event categories. Its attribute ID is 1 and its value is the value
of the attribute OV (Object Value) of the process object at the time of event.
Consequently, its value type depends on the type of the process object.
3.7.6. IOPCEventSubscriptionMgt2
This optional interface has not been implemented.
3.7.7. IOPCEventSink
IOPCEventSink::OnEvent
Note 1: The following bits of the wChangeMask member of the event notification
are set by the server:
• OPC_CHANGE_ACTIVE_STATE
• OPC_CHANGE_ACK_STATE
• OPC_CHANGE_ACTIVE_STATE
• OPC_CHANGE_QUALITY
• OPC_CHANGE_SUBCONDITION
The following bits are not set:
• OPC_CHANGE_SEVERITY
• OPC_CHANGE_MESSAGE
• OPC_CHANGE_ATTRIBUTE
Note2: The szMessage member of the event notification is subject to localization. It
is sent in the language specified by the client (using SetLocaleID), or else in the
default language of the SYS 600 application.
Note3: The default value of the szActorID member of the event notification is the
name of the MicroSCADA user who caused the event.
40
1MRS756659 MicroSCADA Pro SYS 600 9.3
OPC Server
Technical Description
4.1. General
The SYS 600 Application OPC Server (AOPCS) is an implementation of the
interface specification OPC Data Access Custom Interface Standard, Version
2.05A, on the SYS 600 system.
The Application OPC Server is a proxy server that acts as a gateway between an
OPC data access client and the Data Access Server of a SYS 600 system. It is
normally run in the computer where the client application is run and started and
stopped automatically by COM. It may also run as a DCOM server in another
computer, but hardly any benefit can be seen in such a configuration.
The Application OPC Server is normally used in redundant (HSB) SYS 600
systems. Each AOPCS instance is associated with a SYS 600 application, the home
application of the instance. AOPCS monitors the state of the home application in the
redundant system. On the event of HSB switch-over, it automatically connects to the
newly hot application. The client applications continue to run undisturbed and
without loss of data.
The Application OPC Server can also be used in a non-redundant SYS 600 system.
This is especially useful if the DCOM connection between the OPC client and the
SYS 600 Data Access Server is unreliable, since AOPCS can provide seamless
handling of connection breaks, including automatic recovery of lost events.
Some other reasons for using AOPCS in a non-redundant system might be:
• The client application does not support DCOM servers.
• For a reason or another, the client application does not want to bind to absolute
OPC item names (containing the application number).
• If redundancy (HSB) is later introduced, no changes or reconfiguration are
needed in the client application.
Because the Application OPC Server is a proxy server, the details of the OPC
implementation of the Data Access Server, described in Chapter 2, apply to AOPCS
as well. A slight difference in the semantics of application relative name spaces is
described in Section 4.4. The added functionality is described in Section 4.3.
The home application and its location(s) in the SYS 600 system are specified in the
configuration file of the AOPCS instance, see Section 4.2.
The Application OPC Server is installed in each computer where client applications
are run.
4.2. Configuration
Configuration file
An Application OPC Server instance is configured by the home application specific
configuration file AOPCS_instance.INI located in the directory where the program
aopcs.exe is installed. The name of the SYS 600 application is typically used as the
server instance name ‘instance’.
41
SYS 600 9.3 MicroSCADA Pro 1MRS756659
OPC Server
Technical Description
Registration
After the configuration file has been created, the server instance must be registered
in the registry of Windows. This is done by running AOPCS in command line.
aopcs instance -regserver
The DEMO instance configured above is registered by the command:
aopcs DEMO -regserver
After a successful registration, AOPCS adds its newly created COM class ID to the
configuration file, for example:
CLSID={40838188-4B1F-4C10-A08C-4BD3AF66BBC8}
The same command may be used to re-register an AOPCS instance: If the
configuration file already contains a CLSID line, AOPCS only registers the instance
with this CLSID without generating a new one.
The class ID is used by the OPC client application to connect to the correct instance
of the Application OPC Server.
42
1MRS756659 MicroSCADA Pro SYS 600 9.3
OPC Server
Technical Description
The success or possible errors during registration are reported in the Windows Event
Log.
4.3. Functionality
Start-up
The Application OPC Server does not need to be explicitly started. When an OPC
client tries to connect to the CLSID registered for an AOPCS instance, COM will
automatically run AOPCS to serve the client. When the last client disconnects,
AOPCS will shut down.
Possible errors during the start-up are reported in the Windows Event Log.
States
AOPCS constantly monitors the SYS 600 applications specified in the INI file. The
availability of a hot SYS 600 application determines the state of AOPCS. Clients
can query the state by the method IOPCServer::GetStatus.
During the start-up, AOPCS will try to connect to a hot application. If none is found
in 10 seconds, AOPCS will start in SUSPENDED (OPC_STATUS_SUSPENDED)
state.
When a hot SYS 600 application is available, AOPCS state is RUNNING
(OPC_STATUS_RUNNING). This is the normal operational state.
43
SYS 600 9.3 MicroSCADA Pro 1MRS756659
OPC Server
Technical Description
When neither application of the HSB pair is hot, or the SYS 600 base systems are
down, or their Data Access Servers are not running, the state is SUSPENDED. Most
OPC interface calls will simply return E_FAIL.
HSB switch-over
When the connection to the hot application is lost for a reason or another and the
other SYS 600 system is available, AOPCS checks whether an HSB switch-over is
taking place. If it is, AOPCS waits for the switch-over to complete and reconnects
to the newly hot application.
During the reconnection, the following actions are taken:
• The items of cyclic groups (update rate > 0) are reconnected and the values that
have changed since the last ones received from the previously hot application are
sent to the client of AOPCS.
• The items of event based groups (update rate = 0) are reconnected and a replay
request is sent to the SYS 600 Data Access Server. The Data Access Server then
sends back all the events of these items since the start-up of the newly hot
application in the order of their occurrence. AOPCS then conveys them to its
client. No events are lost.
• The pending OPC client requests, i.e. the ones done during the reconnection, are
completed in the newly hot application.
Effectively, the client will see nothing but a brief stop in the data callback flow and
some delay in OPC interface calls made during the reconnection.
Connection break
A connection break is detected when AOPCS loses the hot application and no
HSB switch-over is taking place. The behavior during a connection break is
determined by ‘hiding time’ and ‘recovery time’ values set in the configuration file,
see Section 4.2.
If connection to a hot application is re-established within ‘hiding time’, the
connection break will not be visible to the client at all. The reconnection procedure
is similar to the reconnection after an HSB switch-over: the event replaying
mechanism guarantees that no events are lost for event based groups (update
rate = 0).
If the connection is not re-established within ‘hiding time’, AOPCS will go to
SUSPENDED state. Client callbacks, where all the items are set to UNCERTAIN
quality, substatus ‘last known’, are sent to the client. The ‘recovery time’ begins at
this moment.
When the connection is later recovered within the ‘recovery time’, AOPCS will go
back to RUNNING state and items will automatically wake up. Again, no events are
lost for event based groups (update rate = 0).
Finally, if the connection cannot be established within ‘recovery time’, all items will
be set to BAD quality, substatus ‘out of service’. When the connection to a hot
application is later recovered, items will automatically wake up and the refreshed
values are sent to the client. However, lost events will not be recovered since the
‘recovery time’ has expired.
44
1MRS756659 MicroSCADA Pro SYS 600 9.3
OPC Server
Technical Description
For clients that depend on the ‘no events lost’ concept, it is important to understand
the meaning of OPC item status. AOPCS guarantees complete event recovery after
a connection break as long as item status remains ‘UNCERTAIN, last known’.
Whenever events are lost for one reason or another, AOPCS reports the loss of
events to the client by status ‘BAD, out of service’.
The default value of ‘recovery time’ is -1, e.g. no time limit at all. With this setting,
items are actually never set to ‘BAD, out of service’ state during a connection break
but will remain in ‘UNCERTAIN, last known’ state indefinitely. The only factor
limiting event recovering in this case is the event buffer size in the SYS 600 Data
Access Server (currently appr. 60 000 events). If the event replaying after a
connection break fails due to a buffer overflow, AOPCS will set items to BAD status
to report that events may have been lost. After that, however, a ‘fresh’ connection
(without event replaying) is immediately established and new refreshed item values
are sent to the client.
45
SYS 600 9.3 MicroSCADA Pro 1MRS756659
OPC Server
Technical Description
46
1MRS756659 MicroSCADA Pro SYS 600 9.3
OPC Server
Technical Description
6. Index
Symbols
#MODIFY ................................................................................................ 34
#SET ......................................................................................................... 34
A
Absolute name space ............................................................................ 7, 45
Access paths ............................................................................................. 33
Alarms and Events Server .................................................................. 37, 41
AOPCS ..................................................................................................... 41
Application relative name space ........................................................... 7, 45
B
BIT_STRING ........................................................................................... 19
Blobs ......................................................................................................... 33
BOOLEAN ............................................................................................... 19
BYTE_STRING ....................................................................................... 19
C
Conditions ................................................................................................. 38
D
Data Access Server ..................................................................................... 7
Data types ................................................................................................. 18
E
Error codes ................................................................................................ 23
Event properties ........................................................................................ 16
Event sources ............................................................................................ 38
F
FAILURE_HIDING_TIME ..................................................................... 42
FAILURE_RECOVERY_TIME .............................................................. 42
H
HSB .......................................................................................................... 41
I
IAdviseSink .............................................................................................. 35
IDataObject ............................................................................................... 35
INTEGER ................................................................................................. 19
IOPCAsyncIO ........................................................................................... 35
IOPCAsyncIO2 ......................................................................................... 34
Read 24, 34
Write 24, 34
IOPCBrowseServerAddressSpace ............................................................ 32
47
SYS 600 9.3 MicroSCADA Pro 1MRS756659
OPC Server
Technical Description
BrowseAccessPaths 33
BrowseOPCItemIDs 33
IOPCCommon .................................................................................... 29, 39
GetErrorString 24, 31
IOPCDataCallback ................................................................................... 35
OnDataChange 24, 35
OnReadComplete 24
OnWriteComplete 24
IOPCEventAreaBrowser .......................................................................... 39
IOPCEventServer ..................................................................................... 39
AckCondition 39
CreateAreaBrowser 39
DisableConditionByArea 39
DisableConditionBySource 39
EnableConditionByArea 39
EnableConditionBySource 39
GetConditionState 39
QuerySourceConditions 39
TranslateToItemIDs 39
IOPCEventServer2 ................................................................................... 39
IOPCEventSink ........................................................................................ 40
OnEvent 40
IOPCEventSubscriptionMgt
SelectReturnedAttributes 40
SetFilter 39
IOPCEventSubscriptionMgt2 .................................................................. 40
IOPCGroupStateMgt ................................................................................ 33
SetState 33
IOPCItemMgt ........................................................................................... 33
AddItems 24, 33
ValidateItems 24, 33
IOPCItemProperties ................................................................................. 32
AddGroup 31
GetErrorString 24, 31
48
1MRS756659 MicroSCADA Pro SYS 600 9.3
OPC Server
Technical Description
IOPCServerPublicGroups ......................................................................... 32
IOPCSyncIO ............................................................................................. 34
Read 24, 34
Write 24, 34
IPersistFile ................................................................................................ 33
Item properties .......................................................................................... 14
L
LIST .......................................................................................................... 20
LocaleID ................................................................................................... 29
N
NAMESPACE .......................................................................................... 24
NAMESPACE items ................................................................................ 24
O
OAES ........................................................................................................ 37
OPC NAMESPACE ................................................................................. 24
P
POLL ........................................................................................................ 17
Process areas ............................................................................................. 38
Properties .................................................................................................. 14
Property ID ............................................................................................... 15
Public groups ............................................................................................ 32
Q
Quality ................................................................................................ 22, 23
QueryAvailableLocaleIDs ........................................................................ 29
R
REAL ........................................................................................................ 19
Recommended properties ......................................................................... 32
REPORT ................................................................................................... 17
S
SCIL ......................................................................................................... 28
SCIL error codes ....................................................................................... 24
SCIL language items ................................................................................ 27
SCIL PROGRAM ..................................................................................... 28
SetLocaleID .............................................................................................. 29
Simple event ............................................................................................. 38
T
TEXT ........................................................................................................ 19
TIME ........................................................................................................ 19
Time stamps .............................................................................................. 21
Tracking event .......................................................................................... 38
49
U
Update policy ........................................................................................... 17
User defined name space ...................................................................... 8, 45
V
VECTOR .................................................................................................. 19
Vendor specific event attributes ............................................................... 40
Vendor specific properties ................................................................. 14, 32
Contact us
www.abb.com/substationautomation
1MRS756659 B/31.12.2010