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

Variablesare always defined as Propertiesor DataVariablesof other Nodesin the AddressSpace. They are never defined by themselves. A Variableis always part of at least one other Node, but may be related to any number of other Nodes. Variablesare 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 Variablethat the Serverhas. Its data type is defined by the DataType Attribute. It is the only Attributethat does not have a data type associated with it. This allows all Variablesto have a value defined by the same Value Attribute.

DataType

M

NodeId

NodeIdof the DataTypedefinition for the Value Attribute. Standard DataTypesare defined in Clause 8.

ValueRank

M

Int32

This Attributeindicates whether the Value Attributeof the Variableis 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 Attributespecifies 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 value of the ValueRank Attribute. This Attributeshall be null if ValueRank≤ 0.

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

Int32 myArray[346];

then this Variable’s DataTypewould point to an Int32 and the Variable’s ValueRankhas the value 1 and the ArrayDimensionsis an array with one entry having the value 346.

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

AccessLevel

M

AccessLevelType

The AccessLevel Attributeis used to indicate how the Valueof a Variablecan be accessed (read/write) and if it contains current and/or historic data. The AccessLeveldoes not take any user access rights into account, i.e. although the Variableis writable this may be restricted to a certain user / user group.

The AccessLevelType is defined in 8.57.

UserAccessLevel

M

AccessLevelType

The UserAccessLevel Attributeis used to indicate how the Valueof a Variablecan 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 Attributeindicates how “current” the Valueof the Variablewill be kept. It specifies (in milliseconds) how fast the Servercan reasonably sample the value for changes (see OPC 10000-4for a detailed description of sampling interval).

A MinimumSamplingIntervalof 0 indicates that the Serveris to monitor the item continuously. A MinimumSamplingIntervalof -1 means indeterminate.

Historizing

M

Boolean

The Historizing Attributeindicates whether the Serveris actively collecting data for the history of the Variable. This differs from the AccessLevel Attributewhich identifies if the Variablehas any historical data. A value of TRUE indicates that the Serveris actively collecting data. A value of FALSE indicates the Serveris not actively collecting data. Default value is FALSE.

AccessLevelEx

O

AccessLevelExType

The AccessLevelEx Attributeis used to indicate how the Valueof a Variablecan be accessed (read/write), if it contains current and/or historic data and its atomicity. The AccessLevelExdoes not take any user access rights into account, i.e. although the Variableis writable this may be restricted to a certain user / user group. The AccessLevelExis an extended version of the AccessLevel attribute and as such contains the 8 bits of the AccessLevel attribute as the first 8 bits.

The AccessLevelExis 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

Variablescan point to at most one ModellingRule Objectusing a HasModellingRule Reference(see 6.4.4for details on ModellingRules).

HasProperty

0..*

HasProperty Referencesare used to identify the Propertiesof a DataVariable.

Propertiesare not allowed to be the SourceNodeof HasProperty References.

HasComponent

0..*

HasComponent Referencesare used by complex DataVariablesto identify their composed DataVariables.

Propertiesare not allowed to use this Reference.

HasTypeDefinition

1

TheHasTypeDefinition Reference points to the type definition of the Variable. Each Variableshall have exactly one type definition and therefore be the SourceNodeof exactly one HasTypeDefinition Referencepointing to a VariableType. See 4.5for a description of type definitions.

<other References>

0..*

Data Variablesmay be the SourceNodeof any other References.

Propertiesmay only be the SourceNodeof any non-hierarchical Reference.

Standard Properties

NodeVersion

O

String

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

The NodeVersion Propertyis updated each time a Referenceis added or deleted to the Nodethe Propertybelongs to. Attributevalue changes except for the DataType Attributedo not cause the NodeVersionto change. Clientsmay read the NodeVersion Propertyor subscribe to it to determine when the structure of a Nodehas changed.

Although the relationship of a Variableto its DataTypeis not modelled using References, changes to the DataType Attributeof a Variablelead to an update of the NodeVersion Property.

LocalTime

O

TimeZoneDataType

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

This Propertyis 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 Propertyis only used for DataVariables. It does not apply to Properties.

This Propertyspecifies if a null value is allowed for the Value Attributeof the DataVariable. If it is set to true, the Servermay return null values and accept writing of null values. If it is set to false, the Servershall never return a null value and shall reject any request writing a null value.

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

ValueAsText

O

LocalizedText

It is used for DataVariableswith a finite set of LocalizedTextsassociated with its value. For example any DataVariableshaving an Enumeration DataType.

This optional Propertyprovides the localized text representation of the value. It can be used by Clientsonly interested in displaying the text to subscribe to the Propertyinstead of the value attribute.

MaxStringLength

O

UInt32

Only used for DataVariableshaving a String DataType.

This optional Propertyindicates the maximum number of bytes supported by the DataVariable.

MaxCharacters

O

UInt32

Only used for DataVariableshaving a String DataType.

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

MaxByteStringLength

O

UInt32

Only used for DataVariableshaving a ByteString DataType.

This optional Propertyindicates the maximum number of bytes supported by the DataVariable.

MaxArrayLength

O

UInt32

Only used for DataVariableshaving its ValueRank Attributenot set to scalar.

This optional Propertyindicates 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 ByteStringbut an array of the DataType Byte. In that case the MaxArrayLengthapplies.

EngineeringUnits

O

EUInformation

Only used for DataVariableshaving a Number DataType.

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

The Variable NodeClassinherits the base Attributesfrom the Base NodeClassdefined in 5.2.

The Variable NodeClassalso defines a set of Attributesthat describe the Variable’sRuntime value. The Value Attributerepresents the Variablevalue. The DataType, ValueRankand ArrayDimensions Attributesprovide the capability to describe simple and complex values.

The AccessLevel Attributeindicates the accessibility of the Valueof a Variablenot taking user access rights into account. If the OPC UA Serverdoes not have the ability to get the AccessLevelinformation from the underlying system then it should state that it is readable and writable. If a read or write operation is called on the Variablethen the Servershould transfer this request and return the corresponding StatusCodeeven if such a request is rejected. StatusCodesare defined in OPC 10000-4.

The SemanticChangeflag of the AccessLevel Attributeis used for Propertiesthat may change and define semantic aspects of the parent Node. For example, the EngineeringUnit Propertydescribes the semantic of a DataVariable, whereas the Icon Propertydoes not. In this example, if the EngineeringUnit Propertymay change while the Server is running, the SemanticChangeflag shall be set for it.

Serversthat support Eventsubscriptions shall generate a SemanticChangeEvent whenever a Propertywith SemanticChangeflag set changes.

If a Variablehaving a Propertywith SemanticChangeflag set is used in a Subscriptionand the Propertyvalue changes, then the SemanticsChangedbit of the StatusCodeshall be set as defined in OPC 10000-4. Clientssubscribing to a Variableshould look at the StatusCodeto identify if the semantic has changed and retrieve the relevant Propertiesbefore processing the value returned from the Subscription.

The UserAccessLevel Attributeindicates the accessibility of the Valueof a Variabletaking user access rights into account. If the OPC UA Serverdoes 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 Attributecan restrict the accessibility indicated by the AccessLevel Attribute, but not exceed it. Clientsshould not assume access rights based on the UserAccessLevel Attribute. For example it is possible that the Serverreturns an error due to some server specific change which was not reflected in the state of this Attributeat the time the Clientaccessed the Variable.

The MinimumSamplingInterval Attributespecifies how fast the Servercan reasonably sample the valuefor changes. The accuracy of this value (the ability of the Serverto attain “best case” performance) can be greatly affected by system load and other factors.

The Historizing Attributeindicates whether the Serveris actively collecting data for the history of the Variable. See OPC 10000-11for details on historizing Variables.

Clientsmay read or write Variablevalues, or monitor them for value changes, as specified in OPC 10000-4. OPC 10000-8defines additional rules when using the Servicesfor automation data.

To specify its ModellingRule, a Variablecan use at most one HasModellingRule Referencepointing to a ModellingRule Object. ModellingRulesare defined in 6.4.4.

If the Variableis created based on an InstanceDeclaration(see 4.5) it shall have the same BrowseNameas its InstanceDeclaration.

The other Referencesare described separately for Propertiesand DataVariablesin the remainder of 5.6