Two types of Variables are defined, Properties and DataVariables. Although they differ in the way they are used as described in 4.5 and have different constraints described in the remainder of 5.6 they use the same NodeClass described in 5.6.2. The constraints of Properties based on this NodeClass are defined in 5.6.3, the constraints of DataVariables in 5.6.4.

Variables are used to represent values which may be simple or complex. Variables are defined by VariableTypes, as specified in 5.6.5.

Variables are always defined as Properties or DataVariables of other Nodes in the AddressSpace. They are never defined by themselves. A Variable is always part of at least one other Node, but may be related to any number of other Nodes. Variables are defined using the Variable NodeClass, specified in Table 13.

Table 13 – Variable NodeClass

Name

Use

Data Type

Description

Attributes

Base NodeClass Attributes

M

--

Inherited from the Base NodeClass. See 5.2.

Value

M

Defined by the DataType Attribute

The most recent value of the Variable that the Server has. Its data type is defined by the DataType Attribute. It is the only Attribute that does not have a data type associated with it. This allows all Variables to have a value defined by the same Value Attribute.

DataType

M

NodeId

NodeId of the DataType definition for the Value Attribute. The NodeId shall be a valid NodeId of a DataType and shall not be null. Standard DataTypes are defined in Clause 7.23.

ValueRank

M

Int32

This Attribute indicates whether the Value Attribute of the Variable is an array and how many dimensions the array has.

It may have the following values:

n  > 1: the Value is an array with the specified number of dimensions.

OneDimension (1): The value is an array with one dimension.

OneOrMoreDimensions (0): The value is an array with one or more dimensions.

Scalar (−1): The value is not an array.

Any (−2): The value can be a scalar or an array with any number of dimensions.

ScalarOrOneDimension (−3): The value can be a scalar or a one dimensional array.

All DataTypes are considered to be scalar, even if they have array-like semantics like ByteString and String.

ArrayDimensions

O

UInt32[]

This Attribute specifies the maximum supported length of each dimension. If the maximum is unknown the value shall be 0.

The number of elements shall be equal to the number of dimensions of the Value. This Attribute shall be null if the Value is not an array.

For example, if a Variable is defined by the following C array:

Int32 myArray[346];

then this Variable’s DataType would be set to Int32, and the Variable’s ValueRank has the value 1. The ArrayDimensions is an array with a length of one where the element has the value 346.

Regardless of the number of dimensions, the maximum number of elements of an array transferred on the wire is 2147483647 (max Int32).

AccessLevel

M

AccessLevelType

The AccessLevel Attribute is used to indicate how the Value of a Variable can be accessed (read/write) and if it contains current and/or historic data. The AccessLevel does not take any user access rights into account, i.e. although the Variable is writeable this may be restricted to a certain user / user group.

The AccessLevelType is defined in 8.57.

UserAccessLevel

M

AccessLevelType

The UserAccessLevel Attribute is used to indicate how the Value of a Variable can be accessed (read/write) and if it contains current or historic data taking user access rights into account.

The AccessLevelType is defined in 8.57.

MinimumSamplingInterval

O

Duration

The MinimumSamplingInterval Attribute indicates how “current” the Value of the Variable will be kept. It specifies (in milliseconds) how fast the Server can reasonably sample the value for changes (see OPC 10000-4 for a detailed description of sampling interval).

A MinimumSamplingInterval of 0 indicates that the Server is to monitor the item continuously. A MinimumSamplingInterval of −1means indeterminate.

Historizing

M

Boolean

The Historizing Attribute indicates whether the Server is actively collecting data for the history of the Variable. This differs from the AccessLevel Attribute which identifies if the Variable has any historical data. A value of TRUE indicates that the Server is actively collecting data. A value of FALSE indicates the Server is not actively collecting data. Default value is FALSE.

AccessLevelEx

O

AccessLevelExType

The AccessLevelEx Attribute is used to indicate how the Value of a Variable can be accessed (read/write), if it contains current and/or historic data and its atomicity. The AccessLevelEx does not take any user access rights into account, i.e. although the Variable is writeable this may be restricted to a certain user / user group. The AccessLevelEx is an extended version of the AccessLevel attribute and as such contains the 8 bits of the AccessLevel attribute as the first 8 bits.

The AccessLevelEx is a 32-bit unsigned integer with the structure defined in the 8.58.

If this Attribute is not provided the information provided by these additional Fields is unknown.

References

HasModellingRule

0..1

Variables can point to at most one ModellingRule Object using a HasModellingRule Reference (see 6.4.4 for details on ModellingRules).

HasProperty

0..*

HasProperty References are used to identify the Properties of a DataVariable.

Properties are not allowed to be the SourceNode of HasProperty References.

HasComponent

0..*

HasComponent References are used by complex DataVariables to identify their composed DataVariables.

Properties are not allowed to use this Reference.

HasTypeDefinition

1

The HasTypeDefinition Reference points to the type definition of the Variable. Each Variable shall have exactly one type definition and therefore be the SourceNode of exactly one HasTypeDefinition Reference pointing to a VariableType. See 4.6 for a description of type definitions.

<other References>

0..*

Data Variables may be the SourceNode of any other References.

Properties may only be the SourceNode of any NonHierarchical Reference.

Standard Properties

NodeVersion

O

String

The NodeVersion Property is used to indicate the version of a DataVariable. It does not apply to Properties.

The NodeVersion Property is updated each time a Reference is added or deleted to the Node the Property belongs to. Attribute value changes except for the DataType, ValueRank and ArrayDimensions Attributes do not cause the NodeVersion to change. Clients may read the NodeVersion Property or subscribe to it to determine when the structure of a Node has changed.

Although the relationship of a Variable to its DataType, ValueRank and ArrayDimensions is not modelled using References, changes to the DataType, ValueRank or ArrayDimensions Attributes of a Variable lead to an update of the NodeVersion Property.

LocalTime

O

TimeZoneDataType

The LocalTime Property is only used for DataVariables. It does not apply to Properties.

This Property is a structure containing the Offset and the DaylightSavingInOffset flag. The Offset specifies the time difference (in minutes) between the SourceTimestamp (UTC) associated with the value and the time at the location in which the value was obtained. The SourceTimestamp is defined in OPC 10000-4.

If DaylightSavingInOffset is TRUE, then Standard/Daylight savings time (DST) at the originating location is in effect and Offset includes the DST correction. If FALSE then the Offset does not include DST correction and DST may or may not have been in effect.

AllowNulls

O

Boolean

The AllowNulls Property is only used for DataVariables. It does not apply to Properties.

This Property specifies if a null value is allowed for the Value Attribute of the DataVariable. If it is set to TRUE, the Server may return null values and accept writing of null values. If it is set to FALSE, the Server shall never return a null value and shall reject any request writing a null value.

If this Property is not provided, it is Server-specific if null values are allowed or not.

ValueAsText

O

LocalizedText

It is used for DataVariables with a finite set of LocalizedTexts associated with its value. For example any DataVariables having an Enumeration DataType.

This optional Property provides the localized text representation of the value. It can be used by Clients only interested in displaying the text to subscribe to the Property instead of the value attribute.

MaxStringLength

O

UInt32

Only used for DataVariables having a String DataType or a LocalizedText DataType (the text field).

This optional Property indicates the maximum number of bytes supported by the DataVariable.

MaxCharacters

O

UInt32

Only used for DataVariables having a String DataType or a LocalizedText DataType (the text field)

This optional Property indicates the maximum number of Unicode characters supported by the DataVariable.

MaxByteStringLength

O

UInt32

Only used for DataVariables having a ByteString DataType.

This optional Property indicates the maximum number of bytes supported by the DataVariable.

MaxArrayLength

O

UInt32

Only used for DataVariables having its ValueRank Attribute not set to scalar.

This optional Property indicates the maximum length of an array supported by the DataVariable. In a multidimensional array it indicates the overall length. For example, a three-dimensional array of 2 x 3 x 10 has the array length of 60.

NOTE In order to expose the length of an array of bytes do not use the DataType ByteString but an array of the DataType Byte. In that case the MaxArrayLength applies.

EngineeringUnits

O

EUInformation

Only used for DataVariables having a Number DataType (or a subtype of Number) or a Structure DataType where each field has a DataType of Number (or a subtype of Number) and all share the same EngineeringUnit.

This optional Property indicates the engineering units for the value of the DataVariable (e.g. hertz or seconds). Details about the Property and what engineering units should be used are defined in OPC 10000-8. The DataType EUInformation is also defined in OPC 10000-8.

CurrencyUnit

O

CurrencyUnitType

Only used for DataVariables having a subtype of Number DataType.

Its contents are based on ISO 4217.

See https://www.iso.org/iso-4217-currency-codes.html

The Variable NodeClass inherits the base Attributes from the Base NodeClass defined in 5.2.

The Variable NodeClass also defines a set of Attributes that describe the Variable’s Runtime value. The Value Attribute represents the Variable value. The DataType, ValueRank and ArrayDimensions Attributes provide the capability to describe simple and complex values.

The AccessLevel Attribute indicates the accessibility of the Value of a Variable not taking user access rights into account. If the OPC UA Server does not have the ability to get the AccessLevel information from the underlying system then it should state that it is readable and writeable. If a read or write operation is called on the Variable then the Server should transfer this request and return the corresponding StatusCode even if such a request is rejected. StatusCodes are defined in OPC 10000-4.

The SemanticChange flag of the AccessLevel Attribute is used for Properties that may change and define semantic aspects of the parent Node. For example, the EngineeringUnits Property describes the semantic of a DataVariable, whereas the Icon Property does not. In this example, if the EngineeringUnits Property may change while the Server is running, the SemanticChange flag shall be set for it.

Servers that support Event Subscriptions shall generate a SemanticChangeEvent whenever a Property with SemanticChange flag set changes.

If a Variable having a Property with SemanticChange flag set is used in a Subscription and the Property value changes, then the SemanticsChanged bit of the StatusCode shall be set as defined in OPC 10000-4. Clients subscribing to a Variable should look at the StatusCode to identify if the semantic has changed and retrieve the relevant Properties before processing the value returned from the Subscription.

The UserAccessLevel Attribute indicates the accessibility of the Value of a Variable taking user access rights into account. If the OPC UA Server does not have the ability to get any user access rights related information from the underlying system then it should use the same bit mask as used in the AccessLevel Attribute. The UserAccessLevel Attribute can restrict the accessibility indicated by the AccessLevel Attribute, but not exceed it. Clients should not assume access rights based on the UserAccessLevel Attribute. For example it is possible that the Server returns an error due to some server specific change which was not reflected in the state of this Attribute at the time the Client accessed the Variable.

The MinimumSamplingInterval Attribute specifies how fast the Server can reasonably sample the value for changes. The accuracy of this value (the ability of the Server to attain “best case” performance) can be greatly affected by system load and other factors.

The Historizing Attribute indicates whether the Server is actively collecting data for the history of the Variable. See OPC 10000-11 for details on historizing Variables.

Clients may read or write Variable values, or monitor them for value changes, as specified in OPC 10000-4. OPC 10000-8 defines additional rules when using the Services for automation data.

To specify its ModellingRule, a Variable can use at most one HasModellingRule Reference pointing to a ModellingRule Object. ModellingRules are defined in 6.4.4.

If the Variable is created based on an InstanceDeclaration (see 4.6) it shall have the same BrowseName as its InstanceDeclaration.

The other References are described separately for Properties and DataVariables in the remainder of 5.6.

Properties are used to define the characteristics of Nodes. Properties are defined using the Variable NodeClass, specified in Table 13. However, they restrict their use.

Properties are the leaf of any hierarchy; therefore they shall not be the SourceNode of any hierarchical References. This includes the HasComponent or HasProperty Reference, that is, Properties do not contain Properties and cannot expose their complex structure. However, they may be the SourceNode of any NonHierarchical References.

The HasTypeDefinition Reference points to the VariableType of the Property. Since Properties are uniquely identified by their BrowseName, all Properties shall point to the PropertyType defined in OPC 10000-5.

Properties shall always be defined in the context of another Node and shall be the TargetNode of at least one HasProperty Reference. To distinguish them from DataVariables, they shall not be the TargetNode of any HasComponent Reference. Thus, a HasProperty Reference pointing to a Variable Node defines this Node as a Property.

The BrowseName of a Property is always unique in the context of a Node. It is not permitted for a Node to refer to two Variables using HasProperty References having the same BrowseName.

DataVariables represent the content of an Object. DataVariables are defined using the Variable NodeClass, specified in Table 13.

DataVariables identify their Properties using HasProperty References. Complex DataVariables use HasComponent References to expose their component DataVariables.

The Property NodeVersion indicates the version of the DataVariable.

The Property LocalTime indicates the difference between the SourceTimestamp of the value and the standard time at the location in which the value was obtained.

The Property AllowNulls indicates if null values are allowed for the Value Attribute.

The Property ValueAsText provides a localized text representation for enumeration values.

The Property MaxStringLength indicates the maximum number of bytes of a String or the text field of a LocalizedText value. If a Server does not impose a maximum number of bytes or is not able to determine the maximum number of bytes this Property shall not be provided. If this Property is provided, then the MaxCharacters Property shall not be provided.

The Property MaxCharacters indicates the maximum number of Unicode characters of a String or the text field of a LocalizedText value. If a Server does not impose a maximum number of Unicode characters or is not able to determine the maximum number of Unicode characters this Property shall not be provided. If this Property is provided then the MaxStringLength Property shall not be provided.

The Property MaxByteStringLength indicates the maximum number of bytes of a ByteString value. If a Server does not impose a maximum number of bytes or is not able to determine the maximum number of bytes this Property shall not be provided.

The Property MaxArrayLength indicates the maximum allowed array length of the value.

The Property EngineeringUnits indicates the engineering units of the value. There are no additional Properties defined for DataVariables in this part of this document. Additional parts of this series of standards may define additional Properties for DataVariables. OPC 10000-8 defines a set of Properties that can be used for DataVariables.

The Property CurrencyUnit represents the currency of the value. The information in the structure is designed to be suited for human users and for automated systems.

DataVariables may use additional References to define relationships to other Nodes. No restrictions are placed on the types of References used or on the NodeClasses of the Nodes that may be referenced. However, restrictions may be defined by the ReferenceType excluding its use for DataVariables. Standard ReferenceTypes are described in Clause 7.

A DataVariable is intended to be defined in the context of an Object. However, complex DataVariables may expose other DataVariables, and ObjectTypes and complex VariableTypes may also contain DataVariables. Therefore each DataVariable shall be the TargetNode of at least one HasComponent Reference coming from an Object, an ObjectType, a DataVariable or a VariableType. DataVariables shall not be the TargetNode of any HasProperty References. Therefore, a HasComponent Reference pointing to a Variable Node identifies it as a DataVariable.

The HasTypeDefinition Reference points to the VariableType used as type definition of the DataVariable.

If the DataVariable is used as InstanceDeclaration (see 4.6) all Nodes referenced with forward hierarchical References shall have unique BrowseNames in the context of this DataVariable.

VariableTypes are used to provide type definitions for Variables. VariableTypes are defined using the VariableType NodeClass, as specified in Table 14.

Table 14 – VariableType NodeClass

Name

Use

Data Type

Description

Attributes

Base NodeClass Attributes

M

--

Inherited from the Base NodeClass. See 5.2

Value

O

Defined by the DataType attribute

The default Value for instances of this type.

DataType

M

NodeId

NodeId of the data type definition for instances of this type. The NodeId shall be a valid NodeId of a DataType and shall not be null. Standard DataTypes are defined in Clause 7.23.

ValueRank

M

Int32

This Attribute indicates whether the Value Attribute of the VariableType is an array and how many dimensions the array has.

It may have the following values:

n > 1: the Value is an array with the specified number of dimensions.

OneDimension (1): The value is an array with one dimension.

OneOrMoreDimensions (0): The value is an array with one or more dimensions.

Scalar (−1): The value is not an array.

Any (−2): The value can be a scalar or an array with any number of dimensions.

ScalarOrOneDimension (−3): The value can be a scalar or a one dimensional array.

NOTE All DataTypes are considered to be scalar, even if they have array-like semantics like ByteString and String.

ArrayDimensions

O

UInt32[]

This Attribute specifies the length of each dimension for an array value. The Attribute specifies the maximum supported length of each dimension. If the maximum is unknown the value is 0.

The number of elements shall be equal to the value of the ValueRank Attribute. This Attribute shall be null if ValueRank ≤ 0.

For example, if a VariableType is defined by the following C array:

Int32 myArray[346];

then this VariableType’s DataType would point to an Int32, the VariableType’s ValueRank has the value 1 and the ArrayDimensions is an array with one entry having the value 346.

IsAbstract

M

Boolean

A boolean Attribute with the following values:

TRUEit is an abstract VariableType, i.e. no Variable of this type shall exist, only of its subtypes.

FALSEit is not an abstract VariableType, i.e. Variables of this type can exist.

References

HasProperty

0..*

HasProperty References are used to identify the Properties of the VariableType. The referenced Nodes may be instantiated by the instances of this type, depending on the ModellingRules defined in 6.4.4.

HasComponent

0..*

HasComponent References are used for complex VariableTypes to identify their containing DataVariables. Complex VariableTypes can only be used for DataVariables. The referenced Nodes may be instantiated by the instances of this type, depending on the ModellingRules defined in 6.4.4.

HasSubtype

0..*

HasSubtype References identify VariableTypes that are subtypes of this type. The inverse Reference identifies the parent type of this type.

GeneratesEvent

0..*

GeneratesEvent References identify the type of Events instances of this type may generate.

<other References>

0..*

VariableTypes may contain other References that can be instantiated by Variables defined by this VariableType. ModellingRules are defined in 6.4.4.

Standard Properties

NodeVersion

O

String

The NodeVersion Property is used to indicate the version of a Node.

The NodeVersion Property is updated each time a Reference is added or deleted to the Node the Property belongs to. Attribute value changes except for the DataType, ValueRank and ArrayDimensions Attributes do not cause the NodeVersion to change. Clients may read the NodeVersion Property or subscribe to it to determine when the structure of a Node has changed.

Although the relationship of a VariableType to its DataType, ValueRank and ArrayDimensions is not modelled using References, changes to the DataType, ValueRank or ArrayDimensions Attributes of a VariableType lead to an update of the NodeVersion Property.

The VariableType NodeClass inherits the base Attributes from the Base NodeClass defined in 5.2. The VariableType NodeClass also defines a set of Attributes that describe the default or initial value of its instance Variables. The Value Attribute represents the default value. The DataType, ValueRank and ArrayDimensions Attributes provide the capability to describe simple and complex values. The IsAbstract Attribute defines if the type can be directly instantiated.

The VariableType NodeClass uses HasProperty References to define the Properties and HasComponent References to define DataVariables. Whether they are instantiated depends on the ModellingRules defined in 6.4.4.

The Property NodeVersion indicates the version of the VariableType. There are no additional Properties defined for VariableTypes in this document. Additional parts of this series of standards may define additional Properties for VariableTypes. OPC 10000-8 defines a set of Properties that can be used for VariableTypes.

HasSubtype References are used to subtype VariableTypes. VariableType subtypes inherit the general semantics from the parent type. The general rules for subtyping are defined in Clause 6. It is not required to provide the HasSubtype Reference for the supertype, but it is required that the subtype provides the inverse Reference to its supertype.

GeneratesEvent References identify that Variables of the VariableType may be the source of an Event of the specified EventType or one of its subtypes. Servers should make GeneratesEvent References bidirectional References. However, it is allowed to be unidirectional when the Server is not able to expose the inverse direction pointing from the EventType to each VariableType supporting the EventType.

GeneratesEvent References are optional, i.e. Variables may generate Events of an EventType that is not exposed by its VariableType.

VariableTypes may use any additional References to define relationships to other Nodes. No restrictions are placed on the types of References used or on the NodeClasses of the Nodes that may be referenced. However, restrictions may be defined by the ReferenceType excluding its use for VariableTypes. Standard ReferenceTypes are described in Clause 7.

All Nodes referenced with forward hierarchical References shall have unique BrowseNames in the context of the VariableType (see 4.6).

Variables are always based on a VariableType, i.e. they have a HasTypeDefinition Reference pointing to its VariableType.

Clients can create Variables using the AddNodes Service defined in OPC 10000-4. The Service requires specifying the TypeDefinitionNode of the Variable. A Variable created by the AddNodes Service contains all components defined by its VariableType dependent on the ModellingRules specified for the components. However, the Server may add additional components and References to the Variable and its components that are not defined by the VariableType. This behaviour is Server dependent. The VariableType only specifies the minimum set of components that shall exist for each Variable of a VariableType.