A DataSetMessage is produced by a DataSetWriter and contains list of name/value pairs which are specified by the PublishedDataSet associated with the DataSetWriter. The contents of the DataSetMessage are formally described by a DataSetMetaData Object. A DataSetMessage is a JSON object with the fields defined in Table 184.
A key frame DataSetMessage or an event based DataSetMessage contains name and value for all fields of the DataSet.
A delta frame DataSetMessage contains only name and value for the changed fields.
DataSetWriters may periodically provide keep-alive messages which are DataSetMessages without any Payload field.
Table 184 – JSON DataSetMessage definition
Name |
Type |
Description |
DataSetWriterId |
UInt16 |
An identifier for DataSetWriter which created the DataSetMessage. The presence of the value depends on the setting in the JsonDataSetMessageContentMask. It is unique within the scope of a Publisher. |
DataSetWriterName |
String |
The name of the DataSetWriter which created the DataSetMessage. The presence of the value depends on the setting in the JsonDataSetMessageContentMask. |
PublisherId |
String |
A unique identifier for the Publisher. It identifies the source of the message. The presence of the value depends on the setting in the JsonDataSetMessageContentMask. The source is the PublisherId on a PubSubConnection (see 6.2.7.1). If the PublisherId is a UInteger, the UInteger value is converted to a String without leading zeros. The value shall be omitted if the NetworkMessage header is present. |
WriterGroupName |
String |
The name of the WriterGroup which created the DataSetMessage. The presence of the value depends on the setting in the JsonDataSetMessageContentMask. The value shall be omitted if the WriterGroupName is contained in the NetworkMessage header. |
SequenceNumber |
UInt32 |
Sequence number for each new DataSetMessage as defined in 7.2.3. The presence of the value depends on the setting in the JsonDataSetMessageContentMask. For the DataSetMessage MessageType “ua-keepalive”, the sequence number provides the next expected sequence number for the DataSetWriter. |
MetaDataVersion |
ConfigurationVersionDataType |
The version of the DataSetMetaData which describes the contents of the Payload. The presence of the value depends on the setting in the JsonDataSetMessageContentMask. |
MinorVersion |
VersionTime |
The minor version of the DataSetMetaData which describes the contents of the Payload. The presence of the value depends on the setting in the JsonDataSetMessageContentMask. The value shall be omitted if the MetaDataVersion is contained in the DataSetMessage header. |
Timestamp |
DateTime |
The time the DataSetMessage was created. The presence of the value depends on the setting in the JsonDataSetMessageContentMask. |
Status |
StatusCode |
The overall status of the DataSetMessage. The dependencies to the status of DataSet fields are defined in Table 34. The presence of the value depends on the setting in the JsonDataSetMessageContentMask. |
MessageType |
String |
Possible values are “ua-keyframe”, “ua-deltaframe”, “ua-event” and “ua-keepalive”. The presence of the value depends on the setting in the JsonDataSetMessageContentMask. |
Payload |
Object |
A JSON object containing the name-value pairs specified by the PublishedDataSet. The format of the value depends on the DataType of the field and the flags specified by the DataSetFieldContentMask. For MessageType “ua-event”, only Variant or RawData encoding shall be allowed. If bits for DataValue encoding are set, the Variant encoding shall be used. |
All fields with a concrete DataType are encoded using VerboseEncoding if FieldEncoding1 is FALSE and CompactEncoding if FieldEncoding1 is TRUE. See the OPC UA JSON Data encodings defined in OPC 10000-6.
The fields in the DataSetMessage are specified by the DataSetFieldContentMask in the DataSetWriter parameters.
The format of the field values in the Payload depend on the setting of the DataSetFieldContentMask, the FieldEncoding1 and the FieldEncoding2 flag in the DataSetMessageContentMask. The resulting JSON encoding is defined in Table 111.
If the DataSetFieldContentMask is 0x0 or 0x20 (only the RawData flag is set), the DataSetMessage fields are encoded as Variant. Otherwise the fields are encoded as DataValue. If the KeyFrameCount is 0, the DataSetFieldContentMask shall be 0x0 or 0x20.
If the FieldEncoding1 is FALSE in the DataSetMessageContentMask, the Variant at the top level of a field is encoded as a JSON value containing only the value of the Body field. If this Variant contains an ExtensionObject, the ExtensionObject shall be encoded as a Structure without the UaTypeId field. This also applies to the Variant in a DataValue at the top level of a field.
If the RawData flag is set, the UaType fields of Variants and the UaTypeId fields of ExtensionObjects are always omitted.
If the RawData flag ist set, it is not possible to reverse the data in a DataSetReader in the following cases.
- DataSet fields have an abstract DataType in the DataSetMetaData.
- DataSet field values do not match the DataType specified in the DataSetMetaData if they are Structure DataTypes.