Variable
extends BaseNode
in package
Table of Contents
Properties
- $nodeClass : string
- $browseName : string
- $dataType : string
- $description : string
- $displayName : string
- $nodeId : string
- $value : string
Methods
- __construct() : mixed
- Variables hold a value along with metadata such as timestamps and status.
- toArray() : array<string|int, mixed>
- Converts the node and its attributes to an associative array.
Properties
$nodeClass
public
string
$nodeClass
$browseName
protected
string
$browseName
$dataType
protected
string
$dataType
$description
protected
string
$description
= ''
$displayName
protected
string
$displayName
$nodeId
protected
string
$nodeId
$value
protected
string
$value
= ''
Methods
__construct()
Variables hold a value along with metadata such as timestamps and status.
public
__construct(string $nodeId, string $browseName, string $displayName, string $dataType[, string $description = '' ][, string $value = '' ][, string $nodeClass = 'variable' ]) : mixed
In OPC UA, the Variable NodeClass (see OPC UA Part 3, Section 5.6.2) defines the following key attributes:
- Value: The current value held by the Variable.
- DataType: The NodeId of the DataType that defines the type of the variable’s value.
- ValueRank: An integer indicating whether the value is scalar (-1) or an array, and if an array, the number of dimensions.
- ArrayDimensions: (Optional) An array specifying the length of each dimension if the value is an array.
- AccessLevel: A bitmask indicating the access rights for the Variable (e.g. read and/or write).
- UserAccessLevel: Similar to AccessLevel but taking user permissions into account.
- MinimumSamplingInterval: Indicates how often the value is updated by the server (in milliseconds).
- Historizing: A boolean flag indicating if the server is recording historical data for this Variable.
Parameters
- $nodeId : string
-
- Unique identifier for the Variable node.
- $browseName : string
-
- The non-localized BrowseName used for OPC UA navigation.
- $displayName : string
-
- The localized name to display to users.
- $dataType : string
-
- The NodeId of the DataType for the variable's value.
- $description : string = ''
-
- Optional description of the variable.
- $value : string = ''
-
- The current or default value of the variable.
- $nodeClass : string = 'variable'
-
- The OPC UA NodeClass (e.g., "Object", "Variable").
Tags
toArray()
Converts the node and its attributes to an associative array.
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed> —The node represented as an associative array.