Object Serialization is understood in this specification as the aggregation of the Values of different Variables belonging to a subset of the Information Model (SerializationScope) into the Value (SerializationValue) of a single Variable (SerializedData). Clients gain access to all Values in the SerializationScope at once by accessing the SerializationValue.
Figure 1 illustrates the relationship between SerializationScope, SerializationValue, and the SerializationProcess between them.
Figure 1 – Relationship of SerializationScope and SerializationValue
The SerializationProcess taking place during read access creates the SerializationValue. The DataType of the SerializationValue is provided by the DataType Attribute. The Server may create the DataType information at the time when the SerializationValue DataType is accessed.
The Value of the SerializedData Variable may only be generated (serialized) when requested by the Read Service, by a Subscription or in PubSub publishing.
Figure 2 illustrates the SerializationProcess taking place for serving a write access to the SerializationValue.
Figure 2 – SerializationProcess for write access
The creation of the SerializationValue for write access at the Client site needs the knowledge of the SerializationValue DataType.
A SerializationScope is a subset of Nodes in the Information Model which are mapped into the SerializationValue, and which shall take part in a SerializationProcess. A SerializationScope consists of Nodes reachable from a start Node and the start Node itself (SerializationStartNode) if the start Node is a Variable. There may exist an arbitrary number of SerializationScopes.
Since the SerializationScope potentially comprises many Nodes reachable from the SerializationStartNode down to an arbitrary depth, the possibility of limiting the number of Nodes which shall be part of the SerializationScope is needed (see SerializationProperties and 6.2). As shown in Figure 3, “Property2” is reachable from the SerializationStartNode, but is excluded from the SerializationScope.
The Object providing an interface for the configuration of a SerializationScope is the SerializationEntity. It allows settings regarding the content of the DataType representing Variables (SerializationFieldDataType) inside the SerializationValue also and is the parent Object of the SerializedData Variable. The SerializationValue is the Value of the SerializedData Variable. The DataType of the SerializationValue maps all Values of the Variables in the SerializationScope (see Figure 3).
The SerializationProperties are provided by the SerializationEntity (see Figure 3) and allow the configuration of the SerializationScope and the handling of metadata. Including or excluding Nodes referenced using certain ReferenceTypes, limiting the depth of the SerializationScope and settings which companion values like statusCodes shall be part of the SerializationFieldDataType of Variables is also possible (see 6.2 also).
The SerializationStartNode refers to one or more SerializationEntity Objects with a HasSerializationEntity ReferenceType.
Figure 3 shows the relationship of the SerializationStartNode, the SerializationEntity Object, the SerializedData Variable and the SerializationValue containing the serialized Values of the Nodes in the SerializationScope.
Figure 3 – SerializationEntity and SerializationValue
The SerializationFieldDataType of Variables is the DataType used to represent Variables of the SerializationScope inside the SerializationValue. Variables can be represented by the DataType of the Variable itself.
Dependent on SerializationProperties, Variables can be represented by Structure DataTypes also (see 6.4.2). If the Variable has children in the SerializationScope, the SerializationFieldDataType for the Variable is always a Structure DataType (see 6.4.3).
The SerializationFieldDataType of Objects is the Structure DataType used to represent Objects and the child Nodes of these Objects in the SerializationScope (see 6.4.4).
The SerializationFieldDataTypes and the SerializationValue DataType are generated by the Server.
The general concepts laid out above enable the following features and advantages:
- The Structure of the SerializationScope is preserved. This means that the relationship of the Objects and Variables contributing to the SerializationValue is preserved.
- Servers can provide different serializations by providing different SerializationEntities, e.g. for process values or for configuration data as shown in Figure 4. Different SerializationScopes defined on the same data can be tailored to serve different use cases.
- SerializationScopes can comprise other SerializationScopes for one SerializationValue as described in chapter 6.3.6 and shown in Figure 9.
- Access to the SerializationValue is guaranteed to yield a consistent Value unless the NonatomicRead and NonatomicWrite flags of the AccessLevelExType part of the SerializedData Variable’s Attributes are set to 1 (Server specific, see OPC 10000-3).
- When writing of the SerializationValue with NonatomicWrite flag set to 0, the update of the original Values in the SerializationScope is like a transaction. This means if update of one original Values fails, all previously written Values are restored, and no change takes place. Note: Servers unable to support this shall set the NonatomicWrite flag of the SerializedData Variable to 1.
- Writing of the SerializationValue yields one Result Code which is Good only if all original Values in the SerializationScope are successfully updated, otherwise the Result Code is Bad.