The branch uses solution UA PubSub Preview as th base. The implementation is in UA Core Library. It implements the hybrid communication as:
- ServiceProvider - as OPC UA server or services provider
- ServiceConsumer - as OPC UA client or services consumer
The initial scope is to implement OPC UA services:
- Browse
- Read/Write
- MethodCall
- PubSub (in the scope of configuring published topic on the fly via services above)
The final scope is to provide generic interface for providing any of the services.
The name OPC UA Adapter is adopted from literature. Its purpose it to translate OPC UA requests and response from OPC UA information model (data structures) to JSON and back.
The DataSet constitutes the payload of messages provided by the Publisher and consumed by the Subscriber.
The OPC UA Information Model for PubSub configuration in Clause 9 specifies the standard Objects in an OPC UA AddressSpace used to create, modify and expose an OPC UA PubSub configuration.
The “messages” in figure above represent NetworkMessages. Each NetworkMessage includes header information and one or more DataSetMessages.
Each DataSetMessage is created from a DataSet.
The DataSetWriter generates a continuous sequence of DataSetMessages.
Syntax and semantics of DataSets are described by DataSetMetaData.
The selection of information for a DataSet in the Publisher and the data acquisition parameters are called PublishedDataSet. DataSet, DataSetMetaData and PublishedDataSet are detailed in 5.2 of the UA Part14.
The PublishedDataSet is a configuration of the DataSet.
DataSet fields can be defined to represent any information.
For publishing, a DataSet will be encoded into a DataSetMessage. One or more DataSetMessages are combined to form the payload of a NetworkMessage.
A DataSet does not define the mechanism to encode, secure and transport it. The DataSetWriter contains settings for the encoding and transport of a DataSetMessage.
The DataSetClassId shall be in the corresponding field of the DataSetMetaData.
DataSetClass template declaring the content of a DataSet. The DataSetMetaData is identical for all PublishedDataSets that are configured based on this DataSetClass. The DataSetClassId shall be in the corresponding field of the DataSetMetaData.
DataSetMetaData describes the content and semantics of a DataSet. The order of the fields in the DataSetMetaData shall match the order of values in the published DataSetMessages. Subscribers use the DataSetMetaData for decoding the values of a DataSetMessage to a DataSet.
The version of the DataSetMetaData of DataSetMessage allows Subscribers to verify if they have the corresponding DataSetMetaData.
DataSetMessages are embedded in NetworkMessages.
A DataSetMessage field is the representation of a DataSet field in a DataSetMessage. A DataSet field can be represented as a DataValue, as a Variant or as a RawData in the DataSetMessage field. The representation depends on the DataSetFieldContentMask defined in 6.2.4.2.
A DataSetMessage is created from a DataSet. It consists of a header and the encoded fields of the DataSet.
The NetworkMessage is a container for DataSetMessages and includes information shared between DataSetMessages. Its Payload contans one or more DataSetMessages. The NetworkMessage header is not encrypted to enable efficient filtering.
A single Publisher may support multiple PublishedDataSets and multiple DataSetWriters to one or more Message Oriented Middleware. A DataSetWriter is a logical component of a Publisher.
If the Publisher is an OPC UA Server, it can expose the Publisher configuration in its AddressSpace. This information may be created through product-specific configuration tools or through the OPC UA defined Methods.
The first step is the collection of data (DataSet) to be published. The configuration for such a collection is called PublishedDataSet. The PublishedDataSet also defines the DataSetMetaData.
In the next step, a DataSetWriter takes the DataSet and creates a DataSetMessage. DataSetMessages from DataSetWriters in one WriterGroup can be inserted into a single NetworkMessage.
Next is the creation of the NetworkMessage. It uses the data provided from the previous step together with the PublisherId (see 6.2.7.1) defined on the PubSubConnection. The structure of this message is protocol specific.
The final step is delivery of the NetworkMessage to the Message Oriented Middleware through the configured Address.
Subscribers are the consumers of NetworkMessages from the Message Oriented Middleware, they understand the structure of OPC UA PubSub messages.
The NetworkMessage provides unencrypted data in the NetworkMessage header to identify or filter Publishers, DataSetMessages, DataSetClasses etc. (see 5.3). The DataSetMessage is forwarded to the DataSetReader for decoding into a DataSet (see 5.4.2.2 for DataSet reading process).
Once a NetworkMessage has been accepted, it is decrypted and decoded. A DataSetMessage is passed on to a DataSetReader, here the DataSetMetaData is used to decode the DataSetMessage content to a DataSet. The DataSetMetaData in particular provides the complete field syntax including the name, data type, and other relevant Properties like engineering units.
A typical use case is controller to controller or machine to machine communication where both communication partners have a pre-configured list of input and output data Variables and a generic configuration tool establishes the communication by selecting the Variables to be published in the Publisher and then configures the Subscriber to receive the messages from the Publisher and to select the target Variables in the Subscriber.
We strongly encourage community participation and contribution to this project. First, please fork the repository and commit your changes there. Once happy with your changes you can generate a 'pull request'.
You must agree to the contributor license agreement before we can accept your changes. The CLA and "I AGREE" button is automatically displayed when you perform the pull request. You can preview CLA here.