The UADP DataSet payload header and other parts of the NetworkMessage are shown in Figure 30.

Different types of DataSetMessage can be combined in on NetworkMessage.

image033.png

Figure 30 – UADP DataSet payload

The encoding of the UADP DataSet payload header is specified in Table 143. The payload header is unencrypted. This header shall be omitted if bit 6 of the UADPFlags is false.

Table 143 – UADP DataSet payload header

Name

Type

Description

Count

Byte

Number of DataSetMessages contained in the NetworkMessage. The NetworkMessage shall contain at least one DataSetMessage if the NetworkMessage type is DataSetMessage payload.

DataSetWriterIds

UInt16 [Count]

List of DataSetWriterIds contained in the NetworkMessage. The size of the list is defined by the Count.

The DataSetWriterId identifies the PublishedDataSet and the DataSetWriter responsible for sending Messages for the DataSet.

A Subscriber can skip DataSetMessages from DataSetWriters it does not expect DataSetMessages from.

The DataSet payload is defined in Table 144. The payload is encrypted.

Table 144 – UADP DataSet payload

Name

Type

Description

Sizes

UInt16 [Count]

List of byte sizes of the DataSetMessages.

The size of the list is defined by the Count in the DataSet payload header.

If the payload size exceeds 65535, the DataSetMessages shall be allocated to separate NetworkMessages. If a single DataSetMessage exceeds the payload size it shall be split into Chunk NetworkMessages.

This field shall be omitted if count is one or if bit 6 of the UADPFlags is false.

DataSetMessages

DataSetMessage [Count]

DataSetMessages contained in the NetworkMessage. The size of the list is defined by the Count in the DataSet payload header.

The type of encoding used for the DataSetMessages is defined by the DataSetWriter.

The encodings for the DataSetMessage are defined in 7.2.4.5.4.

The DataSetMessage header structure and the relation to other parts in a NetworkMessage is shown in Figure 31.

image034.png

Figure 31 – DataSetMessage header structure

The encoding of the DataSetMessage header structure is specified in Table 145.

The DataSetFieldContentMask and the DataSetMessageContentMask settings of the DataSetWriter control the flags in the fields DataSetFlags1 and DataSetFlags2. The setting of the flags shall not change until the configuration of the DataSetWriter is changed.

Table 145 – DataSetMessage header structure

Name

Type

Description

DataSetFlags1

Byte

Bit 0: DataSetMessage is valid.

If this bit is set to false, the rest of this DataSetMessage is considered invalid, and shall not be processed by the Subscriber.

Bit range 1-2: Field Encoding

00 The DataSet fields are encoded as Variant The Variant can contain a StatusCode instead of the expected DataType if the status of the field is Bad. The Variant can contain a DataValue with the value and the statusCode if the status of the field is Uncertain.

01 RawData Field Encoding

The RawData field encoding is defined in 7.2.4.5.9.

10 DataValue Field Encoding

The DataSet fields are encoded as DataValue. This option is set if the DataSet is configured to send more than the Value.

11 Reserved

Reserved values shall not be used by the sender and the receiver shall skip messages when reserved values are received.

Bit 3: DataSetMessageSequenceNumber enabled

Bit 4: Status enabled

Bit 5: ConfigurationVersionMajorVersion enabled

Bit 6: ConfigurationVersionMinorVersion enabled

Bit 7: DataSetFlags2 enabled

The bit shall be false, if DataSetFlags2 is 0.

DataSetFlags2

Byte

The DataSetFlags2 shall be omitted if bit 7 of the DataSetFlags1 is false.

If the field is omitted, the Subscriber shall handle the related bits as false.

Bit range 0-3: UADP DataSetMessage type

0000Data Key Frame (see 7.2.4.5.5)

If the DataSetFlags2 field is not provided, this is the default DataSetMessage type.

0001Data Delta Frame (see 7.2.4.5.6)

0010Event (see 7.2.4.5.7)

0011Keep Alive (see 7.2.4.5.8)

01xxReserved

1xxxReserved

Reserved values shall not be used by the sender and the receiver shall skip messages when reserved values are received.

Bit 4: Timestamp enabled

Bit 5: PicoSeconds included in the DataSetMessage headerThis bit shall be false if the Timestamp bit is false.

Bit 6: Reserved

Bit 7: Reserved for further extended flag fields

Reserved bits shall be set to false by the Publisher and Subscribers shall skip messages where the reserved bits are not false.

DataSetMessage‌SequenceNumber

UInt16

Sequence number for each new DataSetMessage as defined in 7.2.3.

The field shall be omitted if Bit 3 of DataSetFlags1 is false.

Timestamp

UtcTime

The time the DataSetMessage was created.

The Timestamp shall be omitted if Bit 4 of DataSetFlags2 is false.

PicoSeconds

UInt16

Specifies the number of 10 picoseconds (1,0 e-11 seconds) intervals which shall be added to the Timestamp.

The PicoSeconds field stores the difference between a high-resolution timestamp with a resolution of 10 picoseconds and the Timestamp field value which only has a 100 ns resolution. The PicoSeconds field shall contain values less than 10 000. The decoder shall treat values greater than or equal to 10 000 as the value ‘9.999’.

The field shall be omitted if Bit 5 of DataSetFlags2 is false.

Status

UInt16

The overall status of the DataSetMessage. The dependencies to the status of DataSet fields are defined in Table 26.

This is the high order 16 bits of the StatusCode DataType representing the numeric value of the Severity and SubCode of the StatusCode DataType.

The field shall be omitted if Bit 4 of DataSetFlags1 is false.

ConfigurationVersion

MajorVersion

VersionTime

The major version of the configuration version of the DataSet used as consistency check with the DataSetMetaData available on the Subscriber side.

The field shall be omitted if Bit 5 of DataSetFlags1 is false.

ConfigurationVersion

MinorVersion

VersionTime

The minor version of the configuration version of the DataSet used as consistency check with the DataSetMetaData available on the Subscriber side.

The field shall be omitted if Bit 6 of DataSetFlags1 is false.

The data key frame DataSetMessage data and related headers are shown in Figure 32.

image035.png

Figure 32 – Data Key Frame DataSetMessage data

The encoding of the data key frame DataSetMessage structure is specified in Table 146.

If the key frame is a heartbeat DataSetMessage, only the header is encoded but the following structure shall not be encoded into the DataSetMessage. Generic Subscribers can detect heartbeat DataSetMessages if the DataSetMessage size equals the header size. If the DataSetMessage size is not part of the payload header, the DataSetMessage offset configuration is required on Subscriber side to identify a heartbeat DataSetMessage.

Table 146 – Data Key Frame DataSetMessage structure

Name

Type

Description

FieldCount

UInt16

Number of fields of the DataSet contained in the DataSetMessage.

The FieldCount shall be omitted if RawData field encoding is set in the EncodingFlags defined in 7.2.4.5.4.

DataSetFields

BaseDataType [FieldCount]

The field values of the DataSet.

The field encoding depends on the DataSetFlags1.Field Encoding of the DataSetMessage Header defined in 7.2.4.5.4. The default encoding is Variant if bit 1 and 2 are not set.

Padding

Byte [*]

Optional padding added if the encoded DataSetMessage is smaller than the ConfiguredSize. The DataSetMessage is padded with bytes with value zero.

The data delta frame DataSetMessage data and the related headers are shown in Figure 33.

image036.png

Figure 33 – Data Delta Frame DataSetMessage

The information for a single value in delta frame messages is larger because of the additional index necessary for sending just changed data. The Publisher shall send a key frame message if the delta frame message is larger than a key frame message.

The encoding of the data delta frame DataSetMessage structure is specified in Table 147.

Table 147 – Data Delta Frame DataSetMessage structure

Name

Type

Description

FieldCount

UInt16

Number of fields of the DataSet contained in the DataSetMessage.

DeltaFrameFields

Structure [FieldCount]

The subset of field values of the DataSet contained in the delta frame.

FieldIndex

UInt16

The index of the Field in the DataSet. The index is based on the field position in the DataSetMetaData with the configuration version defined in the ConfigurationVersion field.

A Publisher shall use an index only once in a DataSetMessage.

FieldValue

BaseDataType

The field values of the DataSet.

The field encoding depends on the DataSetFlags1.Field Encoding of the DataSetMessage Header defined in 7.2.4.5.4. The default encoding is Variant if bit 1 and 2 are not set.

Padding

Byte [*]

Optional padding added if the encoded DataSetMessage is smaller than the ConfiguredSize. The DataSetMessage is padded with bytes with value zero.

The Event DataSetMessage data and the related headers are shown in Figure 34.

image037.png

Figure 34 – Event DataSetMessage

The encoding of the Event DataSetMessage structure is specified in Table 148.

Table 148 – Event DataSetMessage structure

Name

Type

Description

FieldCount

UInt16

Number of fields of the DataSet contained in the DataSetMessage.

DataSetFields

BaseDataType [FieldCount]

The field values of the DataSet.

The fields of Event DataSetMessages shall be encoded as Variant.

The Field Encoding DataSetFlags1 of the DataSetMessage header (bit 1 and 2) defined in 7.2.4.5.4 shall be set to false.

Padding

Byte [*]

Optional padding added if the encoded DataSetMessage is smaller than the ConfiguredSize. The DataSetMessage is padded with bytes with value zero.

The keep-alive message does not add any additional fields. The message and the related headers are shown in Figure 35.

image038.png

Figure 35 – KeepAlive message

If the sequence number is contained in the header, the sequence number provides the next expected sequence number for the DataSetWriter.

The encoding of the DataSetMessage fields is handled like a Structure DataType where the DataSet fields are handled like Structure fields and fields with Structure DataType are handled like nested structures but in addition the fields are padded to the maximum size indicated by ArrayDimensions or MaxStringLength. The padding only applies to RawData field encoding.

All restrictions for the encoding of Structure DataTypes also apply to the RawData Field Encoding.

A DataSet field is encoded in the DataType and ValueRank specified in the DataSetMetaData for the DataSet. The following special handling shall be applied to ensure a fixed offset of the fields in the DataSetMessage.

  • If the DataType of a DataSet field or a Structure field is String or ByteString and the actual size is smaller than the maximum possible size indicated by the MaxStringLength, the field shall be padded with bytes with value zero.
  • If the ValueRank is OneDimension (1) or n>1 and the actual size of a dimension in ArrayDimensions is smaller than the maximum possible size indicated by the dimensions, the field shall be padded with bytes with value zero for each dimension.
  • If the DataSet field or Structure field is a Structure with optional fields, the EncodingMask is encoded followed by all fields. Any optional field that is not present is encoded as padding with bytes with value zero. The size of the padding equals to the size needed to encode the field if it were present.
  • If the DataSet field or Structure field is a Union, the encoding of the selected field is padded with bytes with value zero to the size of the longest Union field, when encoded using the rules in this chapter. The case when no field is selected is treated as if there was an encoded field whose encoded size is zero.

The following restrictions apply to the RawData field encoding.

The DataSetMessage valid bit 0 in DataSetFlags1 shall be set to false if the fields do not fulfil these requirements at the time the DataSetMessage is created.