An InstanceDeclaration is an Object, Variable or Method that references a ModellingRule with a HasModellingRule Reference and is the TargetNode of a hierarchical Reference from a TypeDefinitionNode or another InstanceDeclaration. There shall be no two TypeDefinitionNodes referencing the same InstanceDeclaration with a hierarchical Reference, either directly or from another InstanceDeclaration of that TypeDefinitionNode, i.e. an InstanceDeclaration belongs to exactly one TypeDefinitionNode.
The type of an InstanceDeclaration may be abstract, however the instance must be of a concrete type.
If no ModellingRule exists then the Node is neither considered for instantiation of a type nor for subtyping.
If a Node referenced by a TypeDefinitionNode does not reference a ModellingRule it indicates that this Node only belongs to the TypeDefinitionNode and not to the instances. For example, an ObjectType Node may contain a Property that describes scenarios where the type could be used. This Property would not be considered when creating instances of the type. This is also true for subtyping, that is, subtypes of the type definition would not inherit the referenced Node.
The InstanceDeclarationHierarchy of a TypeDefinitionNode contains the TypeDefinitionNode and all InstanceDeclarations that are directly or indirectly referenced from the TypeDefinitionNode using forward hierarchical References.
A similar Node of an InstanceDeclaration is a Node that has the same BrowseName and NodeClass as the InstanceDeclaration and in cases of Variables and Objects the same TypeDefinitionNode or a subtype of it. In the case of a Method a similar Node of an InstanceDeclaration is a Node that also has the same arguments of the InstanceDeclaration, however it may append additional optional arguments and it may specialize the DataType of arguments defined with an abstract DataType to a subtype of the abstract DataType.
A BrowsePath is a sequence of BrowseNames used to describe a path between Nodes related w ith a Reference.
A BrowsePath within a TypeDefinitionNode which include targets of forward hierarchical References shall have a BrowseName that is unique within the TypeDefinitionNode, this same restriction applies to the targets of forward hierarchical References from any InstanceDeclaration. This means that any InstanceDeclaration within the InstanceDeclarationHierarchy can be uniquely identified by a sequence of BrowseNames.
Some restrictions exist regarding the Attributes of InstanceDeclarations when the InstanceDeclaration is overridden or instantiated. The BrowseName and the NodeClass shall never change and always be the same as the original InstanceDeclaration.
In addition, the rules defined in 6.2.8 apply for InstanceDeclarations of the NodeClass Variable.
Some restrictions exist regarding the Attributes of a VariableType or a Variable used as an InstanceDeclaration with regard to the data type of the Value Attribute.
When a Variable used as InstanceDeclaration or a VariableType is overridden or instantiated the following rules apply:
- The DataType Attribute can only be changed to a new DataType if the new DataType is a subtype of the DataType originally used.
- The ValueRank Attribute may only be further restricted
- ‘Any’ may be set to any other value;
- ‘ScalarOrOneDimension’ may be set to ‘Scalar’ or ‘OneDimension’;
- ‘OneOrMoreDimensions’ may be set to a concrete number of dimensions (value > 0).
- All other values of this Attribute shall not be changed.
- The ArrayDimensions Attribute may be added if it was not provided or when modifying the value of an entry in the array from 0 to a different value. All other values in the array shall remain the same.
InstanceDeclarations are identified by their BrowsePath. Different Servers might use different NodeIds for the InstanceDeclarations of common TypeDefinitionNodes, unless the definition of the TypeDefinitionNode already defines a NodeId for the InstanceDeclaration. All TypeDefinitionNodes defined in OPC 10000-5 already define the NodeIds for their InstanceDeclarations and therefore shall be used in all Servers.