The HasStructuredComponent ReferenceType is a concrete ReferenceType and can be used directly. It is a subtype of the HasComponent ReferenceType.

The semantic of this ReferenceType is to indicate that a VariableType or Variable also exposes its Structure fields as Variables in the information model.

The SourceNode of this ReferenceType shall be a VariableType or a Variable having a Structure DataType.

When the Value of the SourceNode is a scalar then the TargetNode shall be a Variable which represents a field of the Structure DataType. The BrowseName of a DataVariable which is exposed shall be the same as the field name of the Structure DataType. The NamespaceIndex of the BrowseName shall be the same as the NamespaceIndex of the Structure DataType which first defines the field. The exposed fields shall be the same DataType and ValueRank as the field in the Structure. The Value is expected to represent the value of the Structure’s field.

When the Value of the SourceNode is an array then the BrowseName of the TargetNode shall be <V[N]> where ‘V’ is the BrowseName of the Parent Node and ‘N’ shall be the array index number of the DataType of the Structure. The NamespaceIndex of the BrowseName shall be the same as the NamespaceIndex of the Structure DataType which first defines the field. For multidimensional arrays the BrowseName shall be <V[M][N][…]>. The Value is expected to represent the value of the array index which the BrowseName describes. An example of this is shown in Figure 36. In this example ‘MyStructuredVariable’ has a Structure DataType with 2 fields, ‘FieldX’ and ‘FieldY’ and an array size of 2.

image039.png

Figure 36 – Example of using HasStructuredComponent ReferencyType

The ReferenceType HasStructuredComponent can be used to expose the entries of a multi-dimensional array of a Variable as subvariables. The same is true for the ModellingRule ExposesItsArray. However, both concepts handle this differently, as described in this section.

Using the HasStructuredComponent ReferenceType, the BrowseName of the subvariable is defined and reflects the place in the array. That is, if the order in the array is changing, e.g. by deleting the first entry, the values of the correponding subvariables change, and the subvariable with the highest index is removed. When subscribing to a subvariable, the Client always get the value assigned to the place in the array. The same behaviour can be achieved when subscribing to the corresponding IndexRange on the parent Variable.

Using the ExposesItsArray ModellingRule, the BrowseName of the subvariables are not defined and do not reflect the place in the array. That is, if the order in the array is changing, e.g. by deleting the first entry, the values of the corresponding subvariables do not change, and the subvariable containing the first entry is removed. When subscribing to a subvariable, the order of the array is not considered. Even if the order is changing, the Client subscribing to the subvariable will observe the original subscribed content.

In Figure 37, an example is given, visualizing the differences. VariableA uses HasStructuredComponent. When the first entry in the array is deleted, the Values of the Variables representing the first and second entry are changed accordingly, and the third Variable is deleted.

VariableB uses ExposesItsArray. When the first entry in the array is deleted, the values of the Variables originally representing the second and third entry of the array do not change, but the Variable representing the first entry is deleted.

image040.png

Figure 37 – Difference between HasStructuredComponent and ExposesItsArray