OPC 10000-6 defines two DataEncodings: CompactEncoding and VerboseEncoding. They have the same structure except VerboseEncoding includes default values.
The main use case for the VerboseEncoding is the payload of DataSetMessages. The VerboseEncoding and the following rules for DataSet field encoding ensure that Subscribers without OPC UA knowledge get messages without OPC UA specific information for normal use cases. At the same time, the rules for special cases and abstract data types ensure that OPC UA aware Subscribers can fully reverse the payload to OPC UA DataTypes if they have access to the DataSetMetaData of the Publisher. The rules for the special cases are defined in 7.2.5.4.3. VerboseEncoding is the recommended default encoding for DataSetMessages.
This specification defines a DataSet field encoding for the VerboseEncoding which simplifies the encoding of Variants and ExtensionObjects by omitting UaType and UaTypeId fields with concrete DataType defined in the FieldMetaData. In this case the Variants at the top level are collapsed. Therefore the DataSet fields in a DataSetMessage for VerboseEncoding are encoded like the fields of a Structure where the fields are described by the FieldMetaData. This includes fields with Enumeration DataTypes which are encoded using verbose Enumeration with the definition in the FieldMetaData.
The additional simplification for VerboseEncoding only applies to the first level of the DataSet fields. For the nested fields in structure DataSet fields, the rules of VerboseEncoding defined in OPC 10000-6 apply.
The following example shows a DataSetMessage with VerboseEncoding and DataSet fields without field specific status and timestamps.
{
"PublisherId":"MyPublisher",
"DataSetWriterId":102,
"SequenceNumber":25460,
"MinorVersion":672341762,
"Timestamp":"2021-09-27T18:45:19.555Z",
"Payload":
{
"LocationName":"Building A",
"Coordinate":
{
"X":1,
"Y":0.2
}
}
}
The following example shows a DataSetMessage with VerboseEncoding and DataSet fields with field specific status and timestamps. Status is omitted if the Code is 0.
{
"PublisherId":"MyPublisher",
"DataSetWriterId":102,
"SequenceNumber":68468,
"MinorVersion":672341762,
"Timestamp":"2021-09-27T18:45:19.555Z",
"Payload":
{
"LocationName":
{
"Value":"Building A",
"Status":{"Code":1073741824,"Symbol":"Uncertain"},
"SourceTimestamp":"2021-09-27T11:32:38.349925Z"
},
"Coordinate":
{
"Value":
{
"X":1,
"Y":0.2
},
"SourceTimestamp":"2021-09-27T11:32:38.349925Z"
}
}
}