Errata exists for this version of the document.
A DataTypeDictionary is an entity that contains a set of type descriptions, such as an XML schema. DataTypeDictionaries are defined as Variables of the VariableType DataTypeDictionaryType.
A DataTypeSystem specifies the format and conventions for defining DataTypes in DataTypeDictionaries. DataTypeSystems are defined as Objects of the ObjectType DataTypeSystemType.
The ReferenceType used to relate Objects of the ObjectType DataTypeSystemType to Variables of the VariableType DataTypeDictionaryType is the HasComponent ReferenceType. Thus, the Variable is always the TargetNode of a HasComponent Reference; this is a requirement for Variables. However, for DataTypeDictionaries the Server shall always provide the inverse Reference, since it is necessary to know the DataTypeSystem when processing the DataTypeDictionary.
Changes may be a result of a change to a type description, but it is more likely that dictionary changes are a result of the addition or deletion of type descriptions. This includes changes made while the Server is offline so that the new version is available when the Server restarts. Clients may subscribe to the DataTypeVersion Property to determine if the DataTypeDictionary has changed since it was last read.
The Server may, but is not required to, make the DataTypeDictionary contents available to Clients through the Value Attribute. Clients should assume that DataTypeDictionary contents are relatively large and that they will encounter performance problems if they automatically read the DataTypeDictionary contents each time they encounter an instance of a specific DataType. The client should use the DataTypeVersion Property to determine whether the locally cached copy is still valid. If the client detects a change to the DataTypeVersion, then it shall re-read the DataTypeDictionary. This implies that the DataTypeVersion shall be updated by a Server even after restart since Clients may persistently store the locally cached copy.
The Value Attribute of the DataTypeDictionary containing the type descriptions is a ByteString whose formatting is defined by the DataTypeSystem. For the “XML Schema” DataTypeSystem, the ByteString contains a valid XML Schema document. For the “OPC Binary” DataTypeSystem, the ByteString contains a string that is a valid XML document. The Server shall ensure that any change to the contents of the ByteString is matched with a corresponding change to the DataTypeVersion Property. In other words, the client may safely use a cached copy of the DataTypeDictionary, as long as the DataTypeVersion remains the same.
DataTypeDictionaries are complex Variables which expose their DataTypeDescriptions as Variables using HasComponent References. A DataTypeDescription provides the information necessary to find the formal description of a DataType within the DataTypeDictionary. The Value of a DataTypeDescription depends on the DataTypeSystem of the DataTypeDictionary. When using “OPC Binary” dictionaries the Value shall be the name of the TypeDescription. When using “XML Schema” dictionaries the Value shall be an Xpath expression (see XPATH) which points to an XML element in the schema document.
Like DataTypeDictionaries each DataTypeDescription provides the Property DataTypeVersion indicating whether the type description of the DataType has changed. Changes to the DataTypeVersion may impact the operation of Subscriptions. If the DataTypeVersion changes for a Variable that is being monitored for a Subscription and that uses this DataTypeDescription, then the next data change Notification sent for the Variable will contain a status that indicates the change in the DataTypeDescription.
DataTypeEncoding Objects of the DataTypes reference their DataTypeDescriptions of the DataTypeDictionaries using HasDescription References. Servers shall provide the inverse References that relate the DataTypeDescriptions back to the DataTypeEncoding Objects. If a DataType Node is exposed in the AddressSpace, it shall provide its DataTypeEncodings and if a DataTypeDictionary is exposed then it should expose all of its DataTypeDescriptions. Both of these References shall be bi-directional.
Figure D.2 provides an example how DataTypes are modelled in the AddressSpace.
Figure D.2 – Example of DataType Modelling
In some scenarios an OPC UA Server may have resource limitations which make it impractical to expose large DataTypeDictionaries. In these scenarios the Server may be able to provide access to descriptions for individual DataTypes even if the entire dictionary cannot be read. For this reason, this standard defines a Property for the DataTypeDescription called DictionaryFragment. This Property is a ByteString that contains a subset of the DataTypeDictionary which describes the format of the DataType associated with the DataTypeDescription. Thus, the Server splits the large DataTypeDictionary into several small parts and Clients can access without affecting the overall system performance.
However, Servers should provide the whole DataTypeDictionary at once if this is possible. It is typically more efficient to read the whole DataTypeDictionary at once instead of reading individual parts.