View Source OpcUA.VariableNode (Opex62541 v0.1.4)
VariableNode
Variables store values in a value
together with metadata for introspection.
Most notably, the attributes data type, value_rank
and array dimensions constrain the possible values the variable can take
on.
Variables come in two flavours: properties and datavariables. Properties are
related to a parent with a hasProperty
reference and may not have child
nodes themselves. Datavariables may contain properties (hasProperty
) and
also datavariables (hasComponents
).
All variables are instances of some variabletypenode
in return
constraining the possible data type, value rank and array dimensions
attributes.
Data Type
The (scalar) data type of the variable is constrained to be of a specific
type or one of its children in the type hierarchy. The data type is given as
a NodeId pointing to a DataTypeNode
in the type hierarchy. See the
Section DataTypeNode
for more details.
If the data type attribute points to UInt32
, then the value attribute
must be of that exact type since UInt32
does not have children in the
type hierarchy. If the data type attribute points Number
, then the type
of the value attribute may still be UInt32
, but also Float
or
Byte
.
Consistency between the data type attribute in the variable and its
VariableTypeNode
is ensured.
Value Rank
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 dimensionsn = 0
: the value is an array with one or more dimensionsn = -1
: the value is a scalarn = -2
: the value can be a scalar or an array with any number of dimensionsn = -3
: the value can be a scalar or a one dimensional array
Consistency between the value rank attribute in the variable and its
variabletypenode
is ensured.
TODO: Array Dimensions
If the value rank permits the value to be a (multi-dimensional) array, the exact length in each dimensions can be further constrained with this attribute.
- For positive lengths, the variable value is guaranteed to be of the same length in this dimension.
- The dimension length zero is a wildcard and the actual value may have any length in this dimension.
Consistency between the array dimensions attribute in the variable and its
variabletypenode
is ensured.
Indicates whether a variable contains data inline or whether it points to an external data source.
Summary
Functions
@spec new(term(), list()) :: %OpcUA.VariableNode{ access_level: term(), args: term(), array: term(), array_dimensions: term(), browse_name: term(), data_type: term(), description: term(), display_name: term(), historizing: term(), minimum_sampling_interval: term(), value: term(), value_rank: term(), write_mask: term() }