Comparison of OPC UA complex data models: Difference between revisions

From OPC Labs Knowledge Base
No edit summary
No edit summary
Line 28: Line 28:
! !! OPC Binary Data Type System !! XML Schema Data Type System !!
! !! OPC Binary Data Type System !! XML Schema Data Type System !!
|-
|-
| '''How are data types described''' || using a XML document conforming to OPC Binary XML schema defined by OPC Foundation || using XML Schema (commonly referred to as XSD), defined by W3C ||
| '''How are data types described''' || using a XML document conforming to OPC Binary XML schema defined by OPC Foundation || using XML Schema (commonly referred to as XSD), defined by W3C || using OPC UA structures
|-
|-
| '''Resulting encoding''' || Binary || XML || any encoding defined in OPC UA (Binary, XML, JSON)
| '''Resulting encoding''' || Binary || XML || any encoding defined in OPC UA (Binary, XML, JSON)
|-
| '''Suitable for small devices''' || yes || usually no (XML schema is too big) || yes
|-
|-
| '''Can refer to data types in other servers''' || yes || yes (details not specified) || no
| '''Can refer to data types in other servers''' || yes || yes (details not specified) || no
Line 38: Line 40:
| '''Selectable byte order''' || yes || no || no
| '''Selectable byte order''' || yes || no || no
|-
|-
| '''Simple data types''' || yes ||rowspan="6"| as per XML Schema capabilities || yes
| '''Simple data types''' || yes ||rowspan="10"| as per XML Schema capabilities || yes
|-
| '''Ability to specify maximum string length''' || no || yes
|-
|-
| '''Opaque data types with bit-sized granularity''' || yes || no
| '''Opaque data types with bit-sized granularity''' || yes || no
Line 44: Line 48:
| '''Enumerated data types''' || yes || yes
| '''Enumerated data types''' || yes || yes
|-
|-
| ||  ||  
| '''Structured data types''' || yes || yes
|-
| '''Structured data types with optional fields based on simple boolean presence flag''' || yes (using switch fields) || yes (directly)
|-
| '''Structured data types with optional fields based on more complex conditions''' || yes || no
|-
| '''Sequences and one-dimensional arrays with given length''' ||  ||  
|-
|-
| ||  ||  
| '''Sequences with specified termination pattern''' ||  ||  
|-
|-
| ||  ||  
| '''Multi-dimensional arrays''' ||  ||  
|-
|-
| '''Supported in QuickOPC''' || Version 2018.1 and later || no || Client-Server, Binary encoding: Version 2020.2 and later
| '''Supported in QuickOPC''' || Version 2018.1 and later || no || Client-Server, Binary encoding: Version 2020.2 and later
|}
|}

Revision as of 13:30, 22 March 2020

OPC UA offers two complex data models. They do not have "official" names, but the historically first one is based on the DataTypeDictionary type, and the second one is based on the DataTypeDefinition type. We will therefore usually refer to them as "DataTypeDictionary model" (or "data type dictionary model"), and "DataTypeDefinition model" (or "data type definition model").

The table below summarizes the main difference between the two models.

DataTypeDictionary Model DataTypeDefinition Model
OPC UA version 1.00 and later (deprecated in 1.04 and later, but still available) 1.04 and later
Described in OPC UA Specification Part 5 (Information Model) OPC UA Specification Part 3 (Address Space Model)
Compatible with OPC UA Client-Server yes yes
Compatible with OPC UA PubSub no yes
OPC Binary Data Type System XML Schema Data Type System
How are data types described using a XML document conforming to OPC Binary XML schema defined by OPC Foundation using XML Schema (commonly referred to as XSD), defined by W3C using OPC UA structures
Resulting encoding Binary XML any encoding defined in OPC UA (Binary, XML, JSON)
Suitable for small devices yes usually no (XML schema is too big) yes
Can refer to data types in other servers yes yes (details not specified) no
Data type inheritance no no yes
Selectable byte order yes no no
Simple data types yes as per XML Schema capabilities yes
Ability to specify maximum string length no yes
Opaque data types with bit-sized granularity yes no
Enumerated data types yes yes
Structured data types yes yes
Structured data types with optional fields based on simple boolean presence flag yes (using switch fields) yes (directly)
Structured data types with optional fields based on more complex conditions yes no
Sequences and one-dimensional arrays with given length
Sequences with specified termination pattern
Multi-dimensional arrays
Supported in QuickOPC Version 2018.1 and later no Client-Server, Binary encoding: Version 2020.2 and later