MindConnect OPC UA PubSub Service¶
The MindConnect OPC UA PubSub Service provides an MQTT-based API to device agents for uploading data according to the OPC UA PubSub Specification. It is an alternative to the HTTP-based MindConnect Service.
The API currently allows to define an asset or event model in MindSphere, representing the customer site setup. Based on the defined model, the uploaded data is converted to asset time series data or to event instances.
OPC 10000-14 - Part 14: PubSub specification released by the OPC UA PubSub Foundation in 2018 enables further adoption of OPC UA at the deepest levels of the shop-floor.
It is expected to have knowledge about OPC 10000-14 - Part 14 PubSub specification.
This document describes the limits, constraints and the deviations from the specification and does not describe OPC UA PubSub.
For further information about OPC UA PubSub, refer OPC UA PubSub API Specification.
For accessing the API, you need to upload your CA Certificate via Settings/Certificate Manager
Agent platforms using this API must support the following technologies:
- MQTT processing
- JSON Web Token (JWT) generation
A publisher is a device agent intending to send data to the MindConnect OPC UA PubSub API via the provided MQTT broker.
A DataSet field contains the actual value as well as additional information about the value, like status and timestamp. The fields of a publisher in the 'MetaDataMessage' represent the data type assets in MindSphere.
The supported transport protocol for the MindConnect OPC UA PubSub messages is MQTT. For more information on the MQTT broker, refer here
For a publisher to connect to the MindSphere for the first time, the TenantAdmin user should upload the CA Certificate for their tenant's devices. While connecting to MindSphere broker, the device uses a self-signed JWT. JWT is signed with the private counterpart of public key residing in device certificate, which is issued by the CA certificate. This CA certificate will be uploaded by TenantAdmin. Broker validates the JWT to confirm that the JWT is valid and the device certificate was issued by a valid tenant CA.
MindConnect OPC UA PubSub Messages¶
MindSphere uses “MetaDataMessage” messages to interpret the publisher’s data.
MetaDataMessage, the data model is created in MindSphere and with the “DataSetMessage”, the time series is written to IoT.
Mindsphere MindConnect OPC UA PubSub API is built based on the official OPC UA Pub Sub Spec Part 14, Release 1.04.24. This spec also contains some specifications referred from previous OPC UA specs:
- OPC UA Pub Sub Spec Part 3, Release 1.04 Address Space Model
- OPC UA Pub Sub Spec Part 5, Release 1.04 Information Model
- OPC UA Pub Sub Spec Part 6, Release 1.04 Mappings
For every publisher that connects to the broker, an agent asset of
core.mcx509 asset type is created automatically. Also, the following asset types will be used for the data modeling of a publisher:
- OPC UA Data Model (core.opcuadatamodel) : Represents OPC UA PubSub device/publisher that publishes field data. The
publisherIDwill be the asset name.
- OPC UA Hierarchy Data Type (
core.opcuahierarcy): If the datapoint name has a hierarchy represented with a "/" or "\", a hierarchy asset will be created accordingly. The string till the last "\" or "/" in the field name in the Field Meta Data will be the name of the asset that will be created of this type.
- OPC UA Data Type (
core.opcuadatatype) : Parent asset type for OPC UA data types. A child asset type with the name
<Tenant>.<Structure Definition Name>will be created. Using this asset type, a datapoint asset is created. The field name in the Field Meta Data will be the name of this asset. If a hierarchy exists, the string after the last "\" or "/" will be used.
The following diagram illustrates the listed asset types, their relation to the Basic Asset Type, and an example sub-type of OPC UA Data Type;
Simple Setup Example¶
Publisher name: simplesimulatorpublisher Data point name: dataFieldName Created Assets
- simplesimulatorpublisher : OPC UA Data Model Type - dataFieldName : Customer1 DataType1 Asset Type
Hierarchical Setup Example¶
Publisher name: simulatorpublisher Data point name: hierarchyPart1/hierarchyPart2/dataFieldName Created Assets
1 2 3 4
- simulatorpublisher : OPC UA Data Model Type - hierarchyPart1 : OPC UA Hierarchy Data Type - hierarchyPart2 : OPC UA Hierarchy Data Type - dataFieldName :Customer1 DataType1 Asset Type
The followning Message Mapping is supported:
- UADP Message Mapping
The following Message Types are supported:
- Data Key Frame DataSetMessage
- Data Delta Frame DataSetMessage
- Discovery Response NetworkMessage
- MetaData Message
A publisher consumes the MindConnect OPC UA PubSub Service for realizing the following tasks:
- Create asset data model
- Upload time series
- Upload events
The manager of a power plant wants to collect sensor data of an electric counter.
A developer writes a field application (publisher) which collects and publishes the counter data. The data is sent to MindSphere via the MindConnect OPC UA Pub Sub API.
Any questions left?
Except where otherwise noted, content on this site is licensed under the MindSphere Development License Agreement.