One of the use cases for PubSub is the publication of data to IT applications through a topic or message queue where the IT application does not have any knowledge about OPC UA. In such a use case, the messages that are sent to the message queue can only contain one DataSetMessage and there should be no OPC UA specific information or header.
The header layout described in this section is optimized for this use case.
This header layout cannot be used for Actions.
A minimal message has the following settings:
- Each NetworkMessage contains one DataSetMessage
- The NetworkMessage header is not included
- The DataSetMessage header is not included
- The DataSet field encoding is set to VerboseEncoding with RawData.
The header layout URI for the mimimal layout as specified in A.3.2.4 is
http://opcfoundation.org/UA/PubSub-Layouts/JSON-Minimal
Table A.16 defines the values for the WriterGroup configuration parameters representing this layout.
Table A.16 – Values for WriterGroup configuration parameters
Parameter |
Value |
JsonNetworkMessageContentMask |
0x4
This value results of the following options: Bit 0: NetworkMessageHeader = 0 Bit 1: DataSetMessageHeader = 0 Bit 2: SingleDataSetMessage = 1 Bit 3: PublisherId = 0 Bit 4: DataSetClassId = 0 Bit 5: ReplyTo = 0 Bit 6: WriterGroupName = 0 |
Table A.17 defines the values for the DataSetWriter configuration parameters representing this layout.
Table A.17 – Values for DataSetWriter configuration parameters
Parameter |
Value |
JsonDataSetMessageContentMask |
0x800 This value results of the following options: Bit 0: DataSetWriterId = 0 Bit 1: MetaDataVersion = 0 Bit 2: SequenceNumber = 0 Bit 3: Timestamp = 0 Bit 4: Status = 0 Bit 5: MessageType = 0 Bit 6: DataSetWriterName = 0 Bit 7: FieldEncoding1 = 0 Bit 8: PublisherId = 0 Bit 9: WriterGroupName = 0 Bit 10: MinorVersion = 0 Bit 11: FieldEncoding2 = 1 |
DataSetFieldContentMask |
0x20 Bit 0: StatusCode = 0 Bit 1: SourceTimestamp = 0 Bit 2: ServerTimestamp = 0 Bit 3: SourcePicoSeconds = 0 Bit 4: ServerPicoSeconds = 0 Bit 5: RawData = 1 |
KeyFrameCount |
configurable |
Example for DataSet1.
{
"Active":true,
"Temperature":25.5,
"Counter":0,
"AdditionalInfo":"The system is running normally (1)"
}
Example for DataSet2.
{
"LocationName":"Building A",
"Coordinate":
{
"X":0,
"Y":0.2
},
"Measurements":
[
20030,
20020,
20010
]
}
Example for DataSet3.
{
"BooleanValue":false,
"Int32Value":0,
"Int64Value":"1",
"UInt32Value":1,
"UInt64Value":"1",
"DoubleValue":0.5,
"DateTimeValue":"2021-09-14T07:14:30Z",
"StringValue":"String 1",
"GuidValue":"ebfc352a-3142-4b99-9bbe-89a517d6a77e",
"StatusCodeValue":
{
"Code":2147483648,
"Symbol":"Bad"
},
"LocalizedTextValue":
{
"Locale":"en"
"Text":"Localized text 1"
},
"ByteStringValue":"AAEC",
"NodeIdValue":"nsu=http://test.org/UA/Data/Instance;s=Pipe001.Valve001.Input",
"QualifiedNameValue":"nsu=http://test.org/UA/Data/;PipeX001"
}