| namespace | http://opcfoundation.org/UA/ |
| nodeClass | VariableType |
| typedDefinition | ServerStatusType i=2138 |
| dataType | ExtensionObject |
| dataType Name | DTServerStatus i=862 |
| value rank | -1 |
| isAbstract | false |
Optional$extensionThe 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 writable this may be restricted to a certain user / user group.
The {{link:AccessLevelType}}
This Attribute specifies the length of each dimension for an array value.
valueRank Attribute.valueRank <=0.example
For example, if a Variable is defined by the following javascript array with 346 Int32 elements:
const myArray = new Array(346).fill(0);
then:
DataType would point to an Int32valueRank has the value 1 and,arrayDimensions is an array with one entry having the value 346.{
dataType: "Int32",
valueRank: 1,
arrayDimensions: [346]
}
Note: the maximum length of an array transferred on the wire is 2147483647 (max Int32) and a multidimensional array is encoded as a one dimensional array.
ReadonlybrowseReadonlydataOptionaldeclaredthe AccessRestrictions the nodeset declared, verbatim, whether or not this loader was asked
to apply them. accessRestrictions above is what is enforced and is gated by the loader's
option; this is what the document said, and is documentation only. Without it a document
loaded with the default policy cannot be written back out as the document it was.
Optionaldesignthe nodeset's DesignToolOnly="true": the node is there for design tools only (a name to
reuse, such as OPC 10000-100 DI's Configuration, Tuning, ... FunctionalGroups), so nothing is
expected to reference it. Documentation only, kept so the node is written back out as declared.
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.
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 Part 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 -1 means indeterminate.
ReadonlynodeReadonlynodeOptionalnodesetthe <Category> elements of the nodeset, in order: the conformance units or facets the
working group filed this node under. Kept, and named, for the same reasons as
nodesetDocumentation: I4AAS has types with a Category property.
Optionalnodesetthe <Documentation> element of the nodeset: a link into the specification text that
defines this node (https://reference.opcfoundation.org/...), at most one. It is not the
Description attribute and no service exposes it; it is kept so that a tool can show where a
node comes from, and so that the node can be written back out as the document that created it.
Named after the element, not documentation: the children of a node are reachable as
properties under their browse name, and DI's ISupportInfoType has a Documentation folder.
OptionalonReadonlyparentOptionalreleasethe maturity a nodeset declares for this node: "Draft" or "Deprecated", or undefined for the default, "Released". It is documentation rather than behaviour -- nothing in the address space acts on it -- but a NodeSet2 document states it, and a node that has forgotten it cannot be written back out as the document that created it.
OptionaluserThe 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.
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:
NOTE:
OptionaloptionalExtensionObject: ExtensionObject | ExtensionObject[]Optionaloptions: BindExtensionObjectOptionsOptionaloptionalExtensionObjectArray: ExtensionObject[]Optionaloptions: BindExtensionObjectOptionsOptionaloptionalExtensionObject: ExtensionObjectOptionaloptions: BindExtensionObjectOptionsOptionaloptions: BindVariableOptionsOptionaloverwrite: booleanbrowse the node to extract information requested in browseDescription
Optionalsession: ISessionContextOptionalnewValue: VariantOptionsWhether a value could be written to this variable, judged on its shape alone: the DataType, the ValueRank and the ArrayDimensions. Returns Good, or the status a write would have been rejected with.
This does not consider access level, user rights or the value's range; it answers the narrower question of whether the Variant fits the variable at all.
OptionaloptionalFilter: CloneFilterOptionalextraInfo: CloneExtraInfofind the the references that are strictly of type reference.
The isForward boolean flag specifies the direction of the references to be looked for.
Forward direction is implied if omitted.
OptionalisForward: booleanfind all the references that are strictly of type reference.
The isForward boolean flag specifies the direction of the references to be looked for.
Forward direction is implied if omitted.
OptionalisForward: booleanfind all the nodes that are referenced by references strictly of type reference.
The isForward boolean flag specifies the direction of the references to be looked for.
Forward direction is implied if omitted.
OptionalisForward: booleanfind all the references that are of type reference or a sub type of reference, in the
direction specified by browseDirection
OptionalbrowseDirection: BrowseDirectionfind all the nodes that are referenced by references of type reference or a
sub type of reference, in the direction specified by browseDirection
OptionalbrowseDirection: BrowseDirectionreturn a complete name of this object by pre-pending name of its parent(s) to its own name
get effective accessRestrictions if (inherited is true) and node has no accessRestrictions, then default accessRestriction from namespace is returned if (inherited is false) and node has no accessRestrictions, then AccessRestrictionsFlag.None is returned
returns the basic type of the variable that correspond to the dataType, that will be used in the dataValue.value.dataType property.
Get the Child by name, if browseName is string and namespaceIndex undefined then the search doesn't care about namespace matching
OptionalnamespaceIndex: numberOptionalnamespaceIndex: numberOptionallocale: string
the locale of the text to return (e.g. en-EN)
return a array of the objects for which this node is an EventSource nodes = HasEventSource => self
return a array with the event source of this object. self = HasEventSource => nodes
return the versioning node
OptionalnamespaceIndex: numberprivate
returns true if the accessLevel flag allows the variable to be readable in the specified context.
returns true if the userAccessLevel flag allows the variable to be readable in the specified context.
returns true if the userAccessLevel flag allows the variable to be writeable in the specified context.
returns true if the accessLevel flag allows the variable to be writeable in the specified context.
OptionalindexRange: NumericRangeOptionaldataEncoding: QualifiedNameLike | nullfrom OPC.UA.Spec 1.02 part 4 5.10.2.4 StatusCodes Table 51 defines values for the operation level statusCode contained in the DataValue structure of each values element. Common StatusCodes are defined in Table 166.
Read Operation Level Result Codes
| Symbolic Id | Description |
|---|---|
| BadNodeIdInvalid | The syntax of the node id is not valid. |
| BadNodeIdUnknown | The node id refers to a node that does not exist in the server address space. |
| BadAttributeIdInvalid | BadAttributeIdInvalid The attribute is not supported for the specified node. |
| BadIndexRangeInvalid | The syntax of the index range parameter is invalid. |
| BadIndexRangeNoData | No data exists within the range of indexes specified. |
| BadDataEncodingInvalid | The data encoding is invalid. This result is used if no dataEncoding can be applied because an Attribute other than Value was requested or the DataType of the Value Attribute is not a subtype of the Structure DataType. |
| BadDataEncodingUnsupported | The server does not support the requested data encoding for the node. This result is used if a dataEncoding can be applied but the passed data encoding is not known to the Server. |
| BadNotReadable | The access level does not allow reading or subscribing to the Node. |
| BadUserAccessDenied | User does not have permission to perform the requested operation. (table 165) |
| BadSecurityModeInsufficient | The operation is not permitted over the current secure channel. |
| BadInsufficientPrivileges | The user does not have enough privileges to perform the requested operation. |
Optionalcontext: ISessionContext | nullOptionalindexRange: NumericRangeOptionaldataEncoding: QualifiedNameLike | nullOptionalstatusCode: StatusCodeOptionalsourceTimestamp: DateOptionalupdateNow: PreciseClockwrite a variable attribute (callback version)
example
const writeValue = {
attributeId: AttributeIds.Value,
dataValue: new DataValue({
statusCode: StatusCodes.Good,
sourceTimestamp: new Date(),
value: new Variant({ dataType: DataType.Double, value: 3.14 })
}),
nodeId
};
myVariable.writeAttribute(context,writeValue,(err, statusCode) => {
if (err) { console.log("Write has failed"); return; }
console.log("write statusCode = ",statusCode.toString());
});
write a variable attribute (async/await version)
example
try {
const writeValue = {
attributeId: AttributeIds.Value,
dataValue: new DataValue({
statusCode: StatusCodes.Good,
sourceTimestamp: new Date(),
value: new Variant({ dataType: DataType.Double, value: 3.14 })
}),
nodeId
};
const statusCode = await myVariable.writeAttribute(context,writeValue);
} catch(err) {
console.log("Write has failed");
return;
}
console.log("write statusCode = ", statusCode.toString());
precondition: UAVariable must have a dataType deriving from "Enumeration"
OptionalindexRange: NumericRange | null