QuickOPC User's Guide and Reference
UAAttributeId Enumeration
Example Example 



OpcLabs.EasyOpcUA Assembly > OpcLabs.EasyOpc.UA Namespace : UAAttributeId Enumeration
Id of an attribute in OPC UA address space.
Syntax
'Declaration
 
<CLSCompliantAttribute(True)>
<ComVisibleAttribute(True)>
<DisplayName2Attribute("OPC-UA Attribute ID")>
<GuidAttribute("8EE73726-1F43-492A-89FD-01E0B5E9907E")>
Public Enum UAAttributeId 
   Inherits System.Enum
   Implements System.IComparable, System.IConvertible, System.IFormattable 
'Usage
 
Dim instance As UAAttributeId
[CLSCompliant(true)]
[ComVisible(true)]
[DisplayName2("OPC-UA Attribute ID")]
[Guid("8EE73726-1F43-492A-89FD-01E0B5E9907E")]
public enum UAAttributeId : System.Enum, System.IComparable, System.IConvertible, System.IFormattable  
[CLSCompliant(true)]
[ComVisible(true)]
[DisplayName2("OPC-UA Attribute ID")]
[Guid("8EE73726-1F43-492A-89FD-01E0B5E9907E")]
public enum class UAAttributeId : public System.Enum, System.IComparable, System.IConvertible, System.IFormattable  
Members
MemberValueDescription
AccessLevel17How a variable may be accessed.
AccessLevelEx27How a variable may be accessed.
AccessRestrictions26The access restrictions assigned to the node.
ArrayDimensions16The length for each dimension of an array value.
BrowseName3A non-localized, human readable name for the node.
ContainsNoLoops11Indicates that following forward references within a view will not cause a loop.
DataType14The node id of the data type for the variable value.
DataTypeDefinition23Provides the metadata and encoding information for custom DataTypes.
Description5A localized description for the node.
DisplayName4A localized, human readable name for the node.
EventNotifier12Indicates that the node can be used to subscribe to events.
Executable21Whether the method can be called.
Historizing20Specifies whether the server is actively collecting historical data for the variable.
InverseName10The browse name for an inverse reference.
IsAbstract8Indicates that a type node may not be instantiated.
MinimumSamplingInterval19Specifies (in milliseconds) how fast the server can reasonably sample the value for changes.
NodeClass2The class of the node.
NodeId1The canonical identifier for the node.
None0No attribute.
RolePermissions24The permissions for the node granted to roles.
Symmetric9Indicates that forward and inverse references have the same meaning.
UserAccessLevel18How a variable may be accessed after taking the user's access rights into account.
UserExecutable22Whether the method can be called by the current user.
UserRolePermissions25The subset of permissions available for the roles available to the current session.
UserWriteMask7Indicates which attributes are writeable by the current user.
Value13The value of a variable.
ValueRank15The number of dimensions in the value.
WriteMask6Indicates which attributes are writeable.
Remarks

Attribute:
"A primitive characteristic of a Node. All Attributes are defined by OPC UA, and may not be defined by Clients or Servers. Attributes are the only elements in the AddressSpace permitted to have data values."

Example
// This example shows how to read the DataType attributes of 3 different nodes at
// once. Using the same method, it is also possible to read multiple attributes
// of the same node.

const UAAttributeId_DataType = 14;

// Instantiate the client object
$Client = new COM("OpcLabs.EasyOpc.UA.EasyUAClient");

$ReadArguments1 = new COM("OpcLabs.EasyOpc.UA.OperationModel.UAReadArguments");
$ReadArguments1->EndpointDescriptor->UrlString = "http://opcua.demo-this.com:51211/UA/SampleServer";
$ReadArguments1->NodeDescriptor->NodeId->ExpandedText = "nsu=http://test.org/UA/Data/;i=10845";
$ReadArguments1->AttributeId = UAAttributeId_DataType;

$ReadArguments2 = new COM("OpcLabs.EasyOpc.UA.OperationModel.UAReadArguments");
$ReadArguments2->EndpointDescriptor->UrlString = "http://opcua.demo-this.com:51211/UA/SampleServer";
$ReadArguments2->NodeDescriptor->NodeId->ExpandedText = "nsu=http://test.org/UA/Data/;i=10853";
$ReadArguments2->AttributeId = UAAttributeId_DataType;

$ReadArguments3 = new COM("OpcLabs.EasyOpc.UA.OperationModel.UAReadArguments");
$ReadArguments3->EndpointDescriptor->UrlString = "http://opcua.demo-this.com:51211/UA/SampleServer";
$ReadArguments3->NodeDescriptor->NodeId->ExpandedText = "nsu=http://test.org/UA/Data/;i=10855";
$ReadArguments3->AttributeId = UAAttributeId_DataType;

$arguments[0] = $ReadArguments1;
$arguments[1] = $ReadArguments2;
$arguments[2] = $ReadArguments3;

// Obtain values. By default, the Value attributes of the nodes will be read.
$results = $Client->ReadMultipleValues($arguments);

// Display results
for ($i = 0; $i < count($results); $i++)
{
    $ValueResult = $results[$i];
    printf("\n");
    if ($ValueResult->Succeeded)
    {
        printf("Value: %s\n", $ValueResult->Value);
        printf("Value.ExpandedText: %s\n", $ValueResult->Value->ExpandedText);
        printf("Value.NamespaceUriString: %s\n", $ValueResult->Value->NamespaceUriString);
        printf("Value.NamespaceIndex: %s\n", $ValueResult->Value->NamespaceIndex);
        printf("Value.NumericIdentifier: %s\n", $ValueResult->Value->NumericIdentifier);
    }
    else
        printf("*** Failure: %s\n", $ValueResult->ErrorMessageBrief);
}

// Example output:
//
//
//Value: SByte
//Value.ExpandedText: nsu=http://opcfoundation.org/UA/;i=2
//Value.NamespaceUriString: http://opcfoundation.org/UA/
//Value.NamespaceIndex: 0
//Value.NumericIdentifier: 2
//
//Value: Float
//Value.ExpandedText: nsu=http://opcfoundation.org/UA/;i=10
//Value.NamespaceUriString: http://opcfoundation.org/UA/
//Value.NamespaceIndex: 0
//Value.NumericIdentifier: 10
//
//Value: String
//Value.ExpandedText: nsu=http://opcfoundation.org/UA/;i=12
//Value.NamespaceUriString: http://opcfoundation.org/UA/
//Value.NamespaceIndex: 0
//Value.NumericIdentifier: 12
Rem This example shows how to read the DataType attributes of 3 different nodes at once. Using the same method, it is also possible 
Rem to read multiple attributes of the same node.

Option Explicit

Const UAAttributeId_DataType = 14

' Instantiate the client object
Dim Client: Set Client = CreateObject("OpcLabs.EasyOpc.UA.EasyUAClient")

Dim ReadArguments1: Set ReadArguments1 = CreateObject("OpcLabs.EasyOpc.UA.OperationModel.UAReadArguments")
ReadArguments1.EndpointDescriptor.UrlString = "http://opcua.demo-this.com:51211/UA/SampleServer"
ReadArguments1.NodeDescriptor.NodeId.ExpandedText = "nsu=http://test.org/UA/Data/;i=10845"
ReadArguments1.AttributeId = UAAttributeId_DataType

Dim ReadArguments2: Set ReadArguments2 = CreateObject("OpcLabs.EasyOpc.UA.OperationModel.UAReadArguments")
ReadArguments2.EndpointDescriptor.UrlString = "http://opcua.demo-this.com:51211/UA/SampleServer"
ReadArguments2.NodeDescriptor.NodeId.ExpandedText = "nsu=http://test.org/UA/Data/;i=10853"
ReadArguments2.AttributeId = UAAttributeId_DataType

Dim ReadArguments3: Set ReadArguments3 = CreateObject("OpcLabs.EasyOpc.UA.OperationModel.UAReadArguments")
ReadArguments3.EndpointDescriptor.UrlString = "http://opcua.demo-this.com:51211/UA/SampleServer"
ReadArguments3.NodeDescriptor.NodeId.ExpandedText = "nsu=http://test.org/UA/Data/;i=10855"
ReadArguments3.AttributeId = UAAttributeId_DataType

Dim arguments(2)
Set arguments(0) = ReadArguments1
Set arguments(1) = ReadArguments2
Set arguments(2) = ReadArguments3

' Obtain values.
Dim results: results = Client.ReadMultipleValues(arguments)

' Display results
Dim i: For i = LBound(results) To UBound(results)
    WScript.Echo

    Dim ValueResult: Set ValueResult = results(i)
    If ValueResult.Succeeded Then
        WScript.Echo "Value: " & ValueResult.Value
        On Error Resume Next
        WScript.Echo "Value.ExpandedText: " & ValueResult.Value.ExpandedText
        WScript.Echo "Value.NamespaceUriString: " & ValueResult.Value.NamespaceUriString
        WScript.Echo "Value.NamespaceIndex: " & ValueResult.Value.NamespaceIndex
        WScript.Echo "Value.NumericIdentifier: " & ValueResult.Value.NumericIdentifier
        On Error Goto 0
    Else
        WScript.Echo "*** Failure: " & ValueResult.ErrorMessageBrief
    End If
Next

' Example output:
'
'Value: SByte
'Value.ExpandedText: nsu=http://opcfoundation.org/UA/ ;i=2
'Value.NamespaceUriString: http://opcfoundation.org/UA/
'Value.NamespaceIndex: 0
'Value.NumericIdentifier: 2
'
'Value: Float
'Value.ExpandedText: nsu=http://opcfoundation.org/UA/ ;i=10
'Value.NamespaceUriString: http://opcfoundation.org/UA/
'Value.NamespaceIndex: 0
'Value.NumericIdentifier: 10
'
'Value: String
'Value.ExpandedText: nsu=http://opcfoundation.org/UA/ ;i=12
'Value.NamespaceUriString: http://opcfoundation.org/UA/
'Value.NamespaceIndex: 0
'Value.NumericIdentifier: 12
Inheritance Hierarchy

System.Object
   System.ValueType
      System.Enum
         OpcLabs.EasyOpc.UA.UAAttributeId

Requirements

Target Platforms: .NET Framework: Windows 10, Windows Server 2012; .NET Core: Linux, macOS, Microsoft Windows

See Also

Reference

OpcLabs.EasyOpc.UA Namespace