IEC 62541-6:2011
(Main)OPC unified architecture - Part 6: Mappings
OPC unified architecture - Part 6: Mappings
IEC 62541-6:2011 specifies the OPC Unified Architecture (OPC UA) mapping between the security model described in IEC 62541-2, the abstract service definitions, described in IEC 62541-4, the data structures defined in IEC 62541-5 and the physical network protocols that can be used to implement the OPC UA specification.
Architecture unifiée OPC - Partie 6: Correspondances
La CEI 62541-6:2011 spécifie les correspondances de l'architecture unifiée OPC (OPC UA) entre le modèle de sécurité décrit dans la IEC 62541-2, les définitions de services abstraits décrites dans la IEC 62541-4, les structures de données définies dans la CEI 62541-5 et les protocoles de réseaux physiques pouvant être utilisés pour mettre en oeuvre la spécification OPC UA.
General Information
Relations
Standards Content (Sample)
IEC 62541-6 ®
Edition 1.0 2011-10
INTERNATIONAL
STANDARD
NORME
INTERNATIONALE
colour
inside
OPC unified architecture –
Part 6: Mappings
Architecture unifiée OPC –
Partie 6: Correspondances
All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized in any form or by
any means, electronic or mechanical, including photocopying and microfilm, without permission in writing from either IEC or
IEC's member National Committee in the country of the requester.
If you have any questions about IEC copyright or have an enquiry about obtaining additional rights to this publication,
please contact the address below or your local IEC member National Committee for further information.
Droits de reproduction réservés. Sauf indication contraire, aucune partie de cette publication ne peut être reproduite
ni utilisée sous quelque forme que ce soit et par aucun procédé, électronique ou mécanique, y compris la photocopie
et les microfilms, sans l'accord écrit de la CEI ou du Comité national de la CEI du pays du demandeur.
Si vous avez des questions sur le copyright de la CEI ou si vous désirez obtenir des droits supplémentaires sur cette
publication, utilisez les coordonnées ci-après ou contactez le Comité national de la CEI de votre pays de résidence.
IEC Central Office
3, rue de Varembé
CH-1211 Geneva 20
Switzerland
Email: inmail@iec.ch
Web: www.iec.ch
About the IEC
The International Electrotechnical Commission (IEC) is the leading global organization that prepares and publishes
International Standards for all electrical, electronic and related technologies.
About IEC publications
The technical content of IEC publications is kept under constant review by the IEC. Please make sure that you have the
latest edition, a corrigenda or an amendment might have been published.
Catalogue of IEC publications: www.iec.ch/searchpub
The IEC on-line Catalogue enables you to search by a variety of criteria (reference number, text, technical committee,…).
It also gives information on projects, withdrawn and replaced publications.
IEC Just Published: www.iec.ch/online_news/justpub
Stay up to date on all new IEC publications. Just Published details twice a month all new publications released. Available
on-line and also by email.
Electropedia: www.electropedia.org
The world's leading online dictionary of electronic and electrical terms containing more than 20 000 terms and definitions
in English and French, with equivalent terms in additional languages. Also known as the International Electrotechnical
Vocabulary online.
Customer Service Centre: www.iec.ch/webstore/custserv
If you wish to give us your feedback on this publication or need further assistance, please visit the Customer Service
Centre FAQ or contact us:
Email: csc@iec.ch
Tel.: +41 22 919 02 11
Fax: +41 22 919 03 00
A propos de la CEI
La Commission Electrotechnique Internationale (CEI) est la première organisation mondiale qui élabore et publie des
normes internationales pour tout ce qui a trait à l'électricité, à l'électronique et aux technologies apparentées.
A propos des publications CEI
Le contenu technique des publications de la CEI est constamment revu. Veuillez vous assurer que vous possédez
l’édition la plus récente, un corrigendum ou amendement peut avoir été publié.
Catalogue des publications de la CEI: www.iec.ch/searchpub/cur_fut-f.htm
Le Catalogue en-ligne de la CEI vous permet d’effectuer des recherches en utilisant différents critères (numéro de référence,
texte, comité d’études,…). Il donne aussi des informations sur les projets et les publications retirées ou remplacées.
Just Published CEI: www.iec.ch/online_news/justpub
Restez informé sur les nouvelles publications de la CEI. Just Published détaille deux fois par mois les nouvelles
publications parues. Disponible en-ligne et aussi par email.
Electropedia: www.electropedia.org
Le premier dictionnaire en ligne au monde de termes électroniques et électriques. Il contient plus de 20 000 termes et
définitions en anglais et en français, ainsi que les termes équivalents dans les langues additionnelles. Egalement appelé
Vocabulaire Electrotechnique International en ligne.
Service Clients: www.iec.ch/webstore/custserv/custserv_entry-f.htm
Si vous désirez nous donner des commentaires sur cette publication ou si vous avez des questions, visitez le FAQ du
Service clients ou contactez-nous:
Email: csc@iec.ch
Tél.: +41 22 919 02 11
Fax: +41 22 919 03 00
IEC 62541-6 ®
Edition 1.0 2011-10
INTERNATIONAL
STANDARD
NORME
INTERNATIONALE
colour
inside
OPC unified architecture –
Part 6: Mappings
Architecture unifiée OPC –
Partie 6: Correspondances
INTERNATIONAL
ELECTROTECHNICAL
COMMISSION
COMMISSION
ELECTROTECHNIQUE
PRICE CODE
INTERNATIONALE
CODE PRIX XB
ICS 25.040.40; 25.100.01 ISBN 978-2-88912-728-3
– 2 – 62541-6 © IEC:2011
CONTENTS
FOREWORD . 6
INTRODUCTION . 8
1 Scope . 9
2 Normative references . 9
3 Terms, definitions and abbreviations . 11
3.1 Terms and definitions . 11
3.2 Abbreviations . 12
4 Overview . 12
5 Data Encoding . 13
5.1 General . 13
5.1.1 Overview . 13
5.1.2 Built-in Types . 14
5.1.3 Guid . 14
5.1.4 ExtensionObject . 15
5.1.5 Variant . 15
5.2 OPC UA Binary . 15
5.2.1 General . 15
5.2.2 Built-in Types . 16
5.2.3 Enumerations . 24
5.2.4 Arrays . 24
5.2.5 Structures . 24
5.2.6 Messages . 25
5.3 XML . 26
5.3.1 Built-in Types . 26
5.3.2 Enumerations . 31
5.3.3 Arrays . 32
5.3.4 Structures . 32
5.3.5 Messages . 33
6 Security Protocols . 33
6.1 Security Handshake . 33
6.2 Certificates . 34
6.2.1 General . 34
6.2.2 Application Instance Certificate . 34
6.2.3 Signed Software Certificate . 35
6.3 WS Secure Conversation. 36
6.3.1 Overview . 36
6.3.2 Notation . 38
6.3.3 Request Security Token (RST/SCT) . 38
6.3.4 Request Security Token Response (RSTR/SCT) . 39
6.3.5 Using the SCT . 40
6.3.6 Cancelling Security Contexts . 40
6.4 OPC UA Secure Conversation . 41
6.4.1 Overview . 41
6.4.2 MessageChunk Structure. 41
6.4.3 MessageChunks and Error Handling . 44
6.4.4 Establishing a SecureChannel . 45
62541-6 © IEC:2011 – 3 –
6.4.5 Deriving Keys . 46
6.4.6 Verifying Message Security . 47
7 Transport Protocols . 48
7.1 OPC UA TCP . 48
7.1.1 Overview . 48
7.1.2 Message Structure . 48
7.1.3 Establishing a Connection . 50
7.1.4 Closing a Connection . 51
7.1.5 Error Handling . 52
7.1.6 Error Recovery . 52
7.2 SOAP/HTTP . 54
7.2.1 Overview . 54
7.2.2 XML Encoding . 55
7.2.3 OPC UA Binary Encoding . 55
7.3 Well Known Addresses . 56
8 Normative Contracts . 56
8.1 OPC Binary Schema . 56
8.2 XML Schema and WSDL . 56
Annex A (normative) Constants. 57
Annex B (normative) Type Declarations for the OPC UA Native Mapping . 59
Annex C (normative) WSDL for the XML Mapping . 60
Annex D (normative) Security Settings Management . 61
Figure 1 – The OPC UA Stack Overview . 13
Figure 2 – Encoding Integers in a Binary Stream . 16
Figure 3 – Encoding Floating Points in a Binary Stream . 17
Figure 4 – Encoding Strings in a Binary Stream . 17
Figure 5 – Encoding Guids in a Binary Stream . 18
Figure 6 – Encoding XmlElements in a Binary Stream . 18
Figure 7 – A String NodeId. 19
Figure 8 – A Two Byte NodeId . 20
Figure 9 – A Four Byte NodeId . 20
Figure 10 – Security Handshake . 33
Figure 11 – Relevant XML Web Services Specifications . 37
Figure 12 – The WS Secure Conversation Handshake . 37
Figure 13 – OPC UA Secure Conversation MessageChunk . 41
Figure 14 – OPC UA TCP Message Structure . 50
Figure 15 – Establishing a OPC UA TCP Connection . 51
Figure 16 – Closing a OPC UA TCP Connection . 51
Figure 17 – Recovering an OPC UA TCP Connection . 53
Table 1 – Built-in Data Types . 14
Table 2 – Guid Structure . 14
Table 3 – Supported Floating Point Types. 16
Table 4 – NodeId Components . 19
– 4 – 62541-6 © IEC:2011
Table 5 – NodeId Encoding Values . 19
Table 6 – Standard NodeId Binary Encoding . 19
Table 7 – Two Byte NodeId Binary Encoding . 20
Table 8 – Four Byte NodeId Binary Encoding . 20
Table 9 – ExpandedNodeId Binary Encoding . 21
Table 10 – DiagnosticInfo Binary Encoding . 21
Table 11 – QualifiedName Binary Encoding . 22
Table 12 – LocalizedText Binary Encoding . 22
Table 13 – Extension Object Binary Encoding . 23
Table 14 – Variant Binary Encoding . 23
Table 15 – Data Value Binary Encoding . 24
Table 16 – Sample OPC UA Binary Encoded Structure . 25
Table 17 – XML Data Type Mappings for Integers . 26
Table 18 – XML Data Type Mappings for Floating Points . 26
Table 19 – Components of NodeId . 28
Table 20 – Components of ExpandedNodeId . 28
Table 21 – Components of Enumeration . 31
Table 22 – SecurityPolicy . 34
Table 23 – ApplicationInstanceCertificate . 35
Table 24 – SignedSoftwareCertificate . 36
Table 25 – WS-* Namespace Prefixes . 38
Table 26 – RST/SCT Mapping to an OpenSecureChannel Request . 39
Table 27 – RSTR/SCT Mapping to an OpenSecureChannel Response . 40
Table 28 – OPC UA Secure Conversation Message Header . 42
Table 29 – Asymmetric Algorithm Security Header . 42
Table 30 – Symmetric Algorithm Security Header . 43
Table 31 – Sequence Header . 43
Table 32 – OPC UA Secure Conversation Message Footer . 44
Table 33 – OPC UA Secure Conversation Message Abort Body . 45
Table 34 – OPC UA Secure Conversation OpenSecureChannel Service . 45
Table 35 – Cryptography Key Generation Parameters . 46
Table 36 – OPC UA TCP Message Header . 48
Table 37 – OPC UA TCP Hello Message . 49
Table 38 – OPC UA TCP Acknowledge Message . 49
Table 39 – OPC UA TCP Error Message . 50
Table 40 – OPC UA TCP Error Codes . 52
Table 41 – WS-Addressing Headers . 54
Table 42 – Well Known Addresses for Local Discovery Servers . 56
Table A.1 – Identifiers Assigned to Attributes . 57
Table D.1 – SecuredApplication . 62
Table D.2 – CertificateIdentfier . 64
Table D.3 – CertificateStoreIdentfier . 65
Table D.4 – CertificateTrustList. 66
62541-6 © IEC:2011 – 5 –
Table D.5 – CertificateValidationOptions . 66
Table D.6 – ApplicationAccessRule. 67
Table D.7 – ApplicationSecurityPolicy . 67
– 6 – 62541-6 © IEC:2011
INTERNATIONAL ELECTROTECHNICAL COMMISSION
____________
OPC UNIFIED ARCHITECTURE –
Part 6: Mappings
FOREWORD
1) The International Electrotechnical Commission (IEC) is a worldwide organization for standardization comprising
all national electrotechnical committees (IEC National Committees). The object of IEC is to promote
international co-operation on all questions concerning standardization in the electrical and electronic fields. To
this end and in addition to other activities, IEC publishes International Standards, Technical Specifications,
Technical Reports, Publicly Available Specifications (PAS) and Guides (hereafter referred to as “IEC
Publication(s)”). Their preparation is entrusted to technical committees; any IEC National Committee interested
in the subject dealt with may participate in this preparatory work. International, governmental and non-
governmental organizations liaising with the IEC also participate in this preparation. IEC collaborates closely
with the International Organization for Standardization (ISO) in accordance with conditions determined by
agreement between the two organizations.
2) The formal decisions or agreements of IEC on technical matters express, as nearly as possible, an international
consensus of opinion on the relevant subjects since each technical committee has representation from all
interested IEC National Committees.
3) IEC Publications have the form of recommendations for international use and are accepted by IEC National
Committees in that sense. While all reasonable efforts are made to ensure that the technical content of IEC
Publications is accurate, IEC cannot be held responsible for the way in which they are used or for any
misinterpretation by any end user.
4) In order to promote international uniformity, IEC National Committees undertake to apply IEC Publications
transparently to the maximum extent possible in their national and regional publications. Any divergence
between any IEC Publication and the corresponding national or regional publication shall be clearly indicated in
the latter.
5) IEC itself does not provide any attestation of conformity. Independent certification bodies provide conformity
assessment services and, in some areas, access to IEC marks of conformity. IEC is not responsible for any
services carried out by independent certification bodies.
6) All users should ensure that they have the latest edition of this publication.
7) No liability shall attach to IEC or its directors, employees, servants or agents including individual experts and
members of its technical committees and IEC National Committees for any personal injury, property damage or
other damage of any nature whatsoever, whether direct or indirect, or for costs (including legal fees) and
expenses arising out of the publication, use of, or reliance upon, this IEC Publication or any other IEC
Publications.
8) Attention is drawn to the Normative references cited in this publication. Use of the referenced publications is
indispensable for the correct application of this publication.
9) Attention is drawn to the possibility that some of the elements of this IEC Publication may be the subject of
patent rights. IEC shall not be held responsible for identifying any or all such patent rights.
International Standard IEC 62541-6 has been prepared by subcommittee 65E: Devices and
integration in enterprise systems, of IEC technical committee 65: Industrial-process
measurement, control and automation.
The text of this standard is based on the following documents:
FDIS Report on voting
65E/193/FDIS 65E/215/RVD
Full information on the voting for the approval of this standard can be found in the report on
voting indicated in the above table.
This publication has been drafted in accordance with the ISO/IEC Directives, Part 2.
62541-6 © IEC:2011 – 7 –
A list of all parts of the IEC 62541 series, published under the general title OPC Unified
Architecture, can be found on the IEC website.
The committee has decided that the contents of this publication will remain unchanged until
the stability date indicated on the IEC web site under "http://webstore.iec.ch" in the data
related to the specific publication. At this date, the publication will be
• reconfirmed,
• withdrawn,
• replaced by a revised edition, or
• amended.
IMPORTANT – The 'colour inside' logo on the cover page of this publication indicates
that it contains colours which are considered to be useful for the correct
understanding of its contents. Users should therefore print this document using a
colour printer.
– 8 – 62541-6 © IEC:2011
INTRODUCTION
This International Stadard is the specification for developers of OPC UA applications. The
specification is a result of an analysis and design process to develop a standard interface to
facilitate the development of applications by multiple vendors that will inter-operate
seamlessly together.
62541-6 © IEC:2011 – 9 –
OPC UNIFIED ARCHITECTURE –
Part 6: Mappings
1 Scope
This part of IEC 62541 specifies the OPC Unified Architecture (OPC UA) mapping between
the security model described in IEC 62541-2, the abstract service definitions, described in
IEC 62541-4, the data structures defined in IEC 62541-5 and the physical network protocols
that can be used to implement the OPC UA specification.
2 Normative references
The following referenced documents are indispensable for the application of this document.
For dated references, only the edition cited applies. For undated references, the latest edition
of the referenced document (including any amendments) applies.
IEC/TR 62541-1, OPC Unfied architecture: Part 1 – Overview and Concepts
IEC 62541-2, OPC Unified architecture: Part 2 – Security Model
IEC 62541-3, OPC Unified architecture: Part 3 – Address Space Model
IEC 62541-4 :----, OPC Unified architecture: Part 4 – Services
IEC 62541-5 , OPC Unified architecture: Part 5 – Information Model
IEC 62541-7 , OPC Unified architecture: Part 7 – Profiles
ITU-T X.690: Information technology – ASN.1 encoding rules: Specification of Basic Encoding
Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER)
available at
ITU-T X.200: Information technology – Open Systems Interconnection – Basic Reference
Model
available at
ITU-T X.509: Information technology – Open Systems Interconnection – The directory: Public
Key and Attribute Certificate Frameworks
available at
XML Schema Part 1: XML Schema Part 1: Structures (Second Edition)
available at
XML Schema Part 2: XML Schema Part 2: Datatypes (Second Edition)
available at
___________
To be published.
To be published.
To be published.
– 10 – 62541-6 © IEC:2011
SOAP Part 1: SOAP Version 1.2 Part 1: Messaging Framework (Second Edition)
available at
SOAP Part 2: SOAP Version 1.2 Part 2: Adjuncts (Second Edition)
available at
XML Encryption: XML Encryption Syntax and Processing
available at
XML Signature: XML-Signature Syntax and Processing (Second Edition)
available at
WS Security: SOAP Message Security 1.1
available at
os-SOAPMessageSecurity.pdf>
WS Addressing: Web Services Addressing (WS-Addressing)
available at
WS Trust: WS Trust 1.3
available at
WS Secure Conversation: WS Secure Conversation 1.3
available at
secureconversation.html>
WS Security Policy: WS Security Policy 1.2
available at
1.2-spec-os.html>
SSL/TLS: RFC 2246 - The TLS Protocol Version 1.0
available at
WS-I Basic Profile Version 1.1
available at
WS-I Basic Security Profile Version 1.1
available at
HTTP: RFC 2616 - Hypertext Transfer Protocol - HTTP/1.1
available at
HTTPS: RFC 2818 - HTTP Over TLS
available at
Base64: RFC 3548 - The Base16, Base32, and Base64 Data Encodings
availble at
IEEE-754: Standard for Binary Floating-Point Arithmetic
available at
HMAC: RFC 2104 - HMAC - Keyed-Hashing for Message Authentication
available at
PKCS #1 : RFC 2437 - PKCS #1 - RSA Cryptography Specifications Version 2.0
available at
62541-6 © IEC:2011 – 11 –
PKCS #12 : PKCS 12 v1.0: Personal Information Exchange Syntax
available at
FIPS 180-2: Secure Hash Standard (SHA)
available at
FIPS 197: Advanced Encyption Standard (AES)
available at
UTF8: RFC 3629 - UTF-8, a transformation format of ISO 10646
available at
RFC 3280: Internet X.509 Public Key Infrastructure Certificate and CRL Profile
available at
RFC 4514: LDAP: String Representation of Distinguished Names
available at
3 Terms, definitions and abbreviations
3.1 Terms and definitions
For the purposes of this document, the terms and defintions given in IEC 62541-1,
IEC 62541-2 and IEC 62541-3 and the following apply.
3.1.1
Data Encoding
Data Encoding is a way to serialize OPC UA messages and data structures
3.1.2
Mapping
specifies how to implement an OPC UA feature with a specific technology
NOTE For example, the OPC UA Binary Encoding is a Mapping that specifies how to serialize OPC UA data
structures as sequences of bytes.
3.1.3
Security Protocol
ensures the integrity and privacy of UA messages that are exchanged between OPC UA
applications
3.1.4
Stack
collection of software libraries that implement one or more Stack Profiles; Stacks have an API
which hides the implementation details from the application developer
3.1.5
Stack Profile
combination of DataEncodings, SecurityProtocol and TransportProtocol Mappings
NOTE OPC UA applications implement one or more StackProfiles and can only communicate with OPC UA
applications that support a StackProfile that they support.
3.1.6
Transport Protocol
represents a way to exchange serialized OPC UA messages between OPC UA applications
– 12 – 62541-6 © IEC:2011
3.2 Abbreviations
API Application Programming Interface
ASN.1 Abstract Syntax Notation #1 (used in ITU-T X.690)
BP WS-I Basic Profile Version
BSP WS-I Basic Security Profile
CSV Comma Separated Value (File Format)
HTTP Hypertext Transfer Protocol
IPSec Internet Protocol Security
RST Request Security Token
OID Object Identifier (used with ASN.1)
RSTR Request Security Token Response
SCT Security Context Token
SHA1 Secure Hash Algorithm
SOAP Simple Object Access Protocol
SSL Secure Sockets Layer (Defined in SSL/TLS)
TCP Transmission Control Protocol
TLS Transport Layer Security (Defined in SSL/TLS)
UTF8 Unicode Transformation Format (8-bit) (Defined in UTF8)
UA Unified Architecture
UASC UA Secure Conversation
WS-* The XML Web Services Specifications
WSS WS Security
WS-SC WS Secure Conversation
XML Extensible Markup Language
4 Overview
Other parts of this series of standards are written to be independent of the technology used
for implementation. This approach means OPC UA is a flexible specification that will continue
to be applicable as technology evolves. On the other hand, this approach means that it is not
possible to build an OPC UA application with the information contained in IEC 62541-1
through to IEC 62541-5 because important implementation details have been left out.
This standard defines Mappings between the abstract specifications and technologies that
can be used to implement them. The Mappings are organized into three groups:
DataEncodings, SecurityProtocols and TransportProtocols. Different Mappings are combined
together to create StackProfiles. All OPC UA applications shall implement at least one
StackProfile and can only communicate with other OPC UA applications that implement the
same StackProfile.
This standard defines the DataEncodings in Clause 5, the SecurityProtocols in Clause 6 and
the TransportProtocols in Clause 7. The StackProfiles are defined in IEC 62541-7.
All communication between OPC UA applications is based on the exchange of Messages. The
parameters contained in the Messages are defined in IEC 62541-4. However, their format is
specified by the DataEncoding and TransportProtocol. For this reason, each Message defined
in IEC 62541-4 shall have a normative description which specifies exactly what shall be put
on the wire. The normative descriptions are defined in the annexes.
62541-6 © IEC:2011 – 13 –
A Stack is a collection of software libraries that implement one or more StackProfiles. The
interface between an OPC UA application and the Stack is a non-normative API which hides
the details of the Stack implementation. An API depends on a specific DevelopmentPlatform.
Note that the datatypes exposed in the API for a DevelopmentPlatform may not match the
datatypes defined by the specification because of limitations of the DevelopmentPlatform. For
example, Java does not support unsigned integers which means any Java API will need to
map unsigned integers onto a signed integer type.
Figure 1 illustrates the relationships between the different concepts defined in this standard.
Client
UA Application
Server
Development Platforms
.NET 3.0
API
ANSI C
JRE 5.0
Data Encodings
Serialization Layer
UA Binary
UA XML
Encoded Message
Security Protocols
WS Secure Conversation
Stack
Secure Channel Layer
UA Secure Conversation
Security Transforms
Signing
Secured Message
Encryption
Transport Protocols
Transport Layer
UA TCP
SOAP/HTTP
WSDL and XML Schema
Wire Protocol
UA Binary Schema
Mappings
Figure 1 – The OPC UA Stack Overview
The layers described in this specification do not correspond to layers in the OSI 7 layer model
[ITU-T X.200]. Each OPC UA StackProfile should be treated as a single Layer 7 (Application)
protocol that is built on an existing Layer 5, 6 or 7 protocol such as TCP/IP, TLS or HTTP.The
SecureChannel layer is always present even if the SecurityMode is None. In this situation, no
security is applied but the SecurityProtocol implementation shall maintain a logical channel
with a unique identifier. Users and Administrators are expected to understand that a
SecureChannel with SecurityMode set to None cannot be trusted unless the Application is
operating on a physically secure network or a low level protocol such as IPSec is being used.
5 Data Encoding
5.1 General
5.1.1 Overview
This standard defines two data encodings: OPC UA Binary and OPC UA XML. It describes
how to construct messages using each of these encodings.
– 14 – 62541-6 © IEC:2011
5.1.2 Built-in Types
All OPC UA DataEncodings are based on rules that are defined for a standard set of built-in
types. These built-in types are then used to construct structures, arrays and messages. The
built-in types are described in Table 1.
Table 1 – Built-in data types
ID Name Description
1 Boolean A two-state logical value (true or false).
2 SByte An integer value between −128 and 127.
3 Byte An integer value between 0 and 256.
4 Int16 An integer value between −32 768 and 32 767.
5 UInt16 An integer value between 0 and 65 535.
6 Int32 An integer value between −2 147 483 648 and 2 147 483 647.
7 UInt32 An integer value between 0 and 429 4967 295.
8 Int64 An integer value between −9 223 372 036 854 775 808 and 9 223 372 036 854 775 807.
9 UInt64 An integer value between 0 and 18 446 744 073 709 551 615.
10 Float An IEEE single precision (32 bit) floating point value.
11 Double An IEEE double precision (64 bit) floating point value.
12 String A sequence of Unicode characters.
13 DateTime An instance in time.
14 Guid A 16 byte value that can be used as a globally unique identifier.
15 ByteString A sequence of octets.
16 XmlElement An XML element.
17 NodeId An identifier for a node in the address space of an OPC UA server.
18 ExpandedNodeId A NodeId that allows the namespace URI to be specified instead of an index.
19 StatusCode A numeric identifier for an error or condition that is associated with a value or an operation.
20 QualifiedName A name qualified by a namespace.
21 LocalizedText Human readable text with an optional locale identifier.
22 ExtensionObject A structure that contains an application specific data type that may not be recognized by the receiver.
23 DataValue A data value with an associated status code and timestamps.
24 Variant A union of all of the types specified above.
25 DiagnosticInfo A structure that contains detailed error and diagnostic information associated with a StatusCode.
Most of these data types are the same as the abstract types defined in IEC 62541-3 and
IEC 62541-4. However, the ExtensionObject and Variant types are defined in this standard. In
addition, this standard defines a representation for the Guid type defined in IEC 62541-3.
5.1.3 Guid
A Guid is a 16-byte globally unique identifier with the layout shown in Table 2.
Table 2 – Guid Structure
Component Data Type
Data1 UInt32
Data2 UInt16
Data3 UInt16
Data4 Byte[8]
Guid values may be represented as a string in this form:
----
62541-6 © IEC:2011 – 15 –
Where Data1 is 8 characters wide, Data2 and Data3 are 4 characters wide and each Byte in
Data4 is 2 characters wide. Each value is formatted as a hexadecimal number padded zeros.
A typical Guid value would look like this when formatted as a string:
C496578A-0DFE-4b8f-870A-745238C6AEAE
5.1.4 ExtensionObject
An ExtensionObject is a container for any complex data types which cannot be encoded as
one of the other built-in data types. The ExtensionObject contains a complex value serialized
as a sequence of bytes or as an XML element. It also contains an identifier which indicates
what data it contains and how it is encoded.
Complex data types are represented in a Server address space as sub-types of the Structure
data type. The encodings available for any given complex data type are represented as a
DataTypeEncoding Object in the Server address space. The NodeId for the
DataTypeEncoding Object is the identifier stored in the ExtensionObject. Subclause 5.8 of
IEC 62541-3 describes how DataTypeEncoding nodes are related to other nodes of the
address space.
Server implementers should use namespace qualified numeric NodeIds for any
DataTypeEncoding Objects they define. This will minimize the overhead introduced by
packing complex data values into ExtensionObjects.
5.1.5 Variant
A Variant is a union of all built-in data types including an ExtensionObject. Variants can also
contain arrays of any of these built-in types. Variants are used to store any value or
parameter with a data type of BaseDataType or one of its subtypes.
Variants can be empty. An empty Variant is described as having a Null value and should be
treated like a NULL column in a SQL database. A Null value in a Variant may not be the same
as a Null value for data types that support Nulls such as Strings. For this reason, all
DataEncodings shall preserve this distinction when encoding Variants.
Variants can contain arrays of Variants but they cannot directly contain another Variant.
DiagnosticInfo type only has meaning when returned in a response message with an
associated StatusCode. As a result, Variants cannot contain instances of DiagnosticInfo.
Variables with a DataType of BaseDataType are mapped to a Variant, however, the
ValueRank and ArrayDimensions Attributes place restrictions on what is allowed in the
Variant. For example, if the ValueRank is Scalar then the Variant may only contain scalar
values.
5.2 OPC UA Binary
5.2.1 General
The OPC UA Binary Encoding is a data format developed to meet the performance needs of
OPC UA applications. This format is designed primarily for fast encoding and decoding,
however, the size of the encoded data on the wire was also a consideration.
The OPC UA Binary Encoding relies on several primitive data types with clearly defined
encoding rules that can be sequentially written to or read from a binary stream. A structure is
encoded by sequentially writing the encoded form of each field. If a given field is also a
structure then the values of its fields are written sequentially before writing the next field in
the containing structure. All fields shall be written to the stream even if they contain Null
– 16 – 62541-6 © IEC:2011
values. The encodings for each primitive type specify how to encode either a Null or a default
value for the type.
The OPC UA Binary Encoding does not include any type or field name information because all
OPC UA applications are expected to have advance knowledge of the services and structures
that they support. An exception is an ExtensionObject which provides an identifier and a size
for the complex structure it represents. This allows a decoder to skip over types that it does
not recognize.
5.2.2 Built-in Types
5.2.2.1 Boolean
A Boolean value shall be encoded as a single byte where a value of 0 (zero) is false and any
non-zero value is true.
Encoders shall use the value of 1 to indicate a true value; however, decoders shall treat any
non-zero value as true.
5.2.2.2 Integer
All integer types shall be encoded as little endian values where the least significant byte
appears first in the stream.
Figure 2 illustrates how value 1 000 000 000 (Hex: 3B9ACA00) should be encoded as a 32 bit
integer in the stream.
00 CA 9A 3B
0 1
...








Questions, Comments and Discussion
Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.
Loading comments...