OPC Studio User's Guide and Reference
UAAttributeId Enumeration
Example Example 



View with Navigation Tools
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
Members
MemberValueDescription
AccessLevel17How a variable may be accessed.

The value of this enum member is 17.

AccessLevelEx27How a variable may be accessed.

Remarks:

This attribute has been added in OPC UA 1.04.

The value of this enum member is 27.

AccessRestrictions26The access restrictions assigned to the node.

Remarks:

This attribute has been added in OPC UA 1.04.

The value of this enum member is 26.

ArrayDimensions16The length for each dimension of an array value.

The value of this enum member is 16.

BrowseName3A non-localized, human readable name for the node.

The value of this enum member is 3.

ContainsNoLoops11Indicates that following forward references within a view will not cause a loop.

The value of this enum member is 11.

DataType14The node id of the data type for the variable value.

The value of this enum member is 14.

DataTypeDefinition23Provides the metadata and encoding information for custom DataTypes.

Remarks:

This attribute has been added in OPC UA 1.04.

The value of this enum member is 23.

Description5A localized description for the node.

The value of this enum member is 5.

DisplayName4A localized, human readable name for the node.

The value of this enum member is 4.

EventNotifier12Indicates that the node can be used to subscribe to events.

The value of this enum member is 12.

Executable21Whether the method can be called.

The value of this enum member is 21.

Historizing20Specifies whether the server is actively collecting historical data for the variable.

The value of this enum member is 20.

InverseName10The browse name for an inverse reference.

The value of this enum member is 10.

IsAbstract8Indicates that a type node may not be instantiated.

The value of this enum member is 8.

MinimumSamplingInterval19Specifies (in milliseconds) how fast the server can reasonably sample the value for changes.

The value of this enum member is 19.

NodeClass2The class of the node.

The value of this enum member is 2.

NodeId1The canonical identifier for the node.

The value of this enum member is 1.

None0No attribute.

The value of this enum member is 0.

RolePermissions24The permissions for the node granted to roles.

Remarks:

This attribute has been added in OPC UA 1.04.

The value of this enum member is 24.

Symmetric9Indicates that forward and inverse references have the same meaning.

The value of this enum member is 9.

UserAccessLevel18How a variable may be accessed after taking the user's access rights into account.

The value of this enum member is 18.

UserExecutable22Whether the method can be called by the current user.

The value of this enum member is 22.

UserRolePermissions25The subset of permissions available for the roles available to the current session.

Remarks:

This attribute has been added in OPC UA 1.04.

The value of this enum member is 25.

UserWriteMask7Indicates which attributes are writable by the current user.

The value of this enum member is 7.

Value13The value of a variable.

The value of this enum member is 13.

ValueRank15The number of dimensions in the value.

The value of this enum member is 15.

WriteMask6Indicates which attributes are writable.

The value of this enum member is 6.

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."

An Attribute ID in OPC UA is a numeric identifier that specifies which attribute of a node is being referred to. Attributes are "properties" of nodes (although OPC UA Properties are a different concept); for example, a node representing a temperature sensor might have attributes for its current value, data type, and description. The Attribute ID allows clients to request or manipulate specific attributes of a node.

Common OPC UA Attributes

Some of the standard attributes defined in OPC UA, along with their typical Attribute IDs, are:

Usage

Clients use Attribute IDs when reading or writing node attributes, or subscribing to changes in a node's value. For example, a client might request the Value attribute of a variable node to get its current value or the DisplayName attribute to show a user-friendly name in the interface.

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.
//
// Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
// OPC client and subscriber examples in C# on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-CSharp .
// Missing some example? Ask us for it on our Online Forums, https://www.opclabs.com/forum/index ! You do not have to own
// a commercial license in order to use Online Forums, and we reply to every post.

using System;
using OpcLabs.BaseLib.OperationModel;
using OpcLabs.EasyOpc.UA;
using OpcLabs.EasyOpc.UA.AddressSpace;
using OpcLabs.EasyOpc.UA.OperationModel;

namespace UADocExamples._EasyUAClient
{
    partial class ReadMultipleValues
    {
        public static void DataType()
        {
            UAEndpointDescriptor endpointDescriptor =
                "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer";
            // or "http://opcua.demo-this.com:51211/UA/SampleServer" (currently not supported)
            // or "https://opcua.demo-this.com:51212/UA/SampleServer/"

            // Instantiate the client object.
            var client = new EasyUAClient();

            // Obtain values.
            ValueResult[] valueResultArray = client.ReadMultipleValues(new[]
                {
                    new UAReadArguments(endpointDescriptor, "nsu=http://test.org/UA/Data/ ;i=10845", UAAttributeId.DataType),
                    new UAReadArguments(endpointDescriptor, "nsu=http://test.org/UA/Data/ ;i=10853", UAAttributeId.DataType),
                    new UAReadArguments(endpointDescriptor, "nsu=http://test.org/UA/Data/ ;i=10855", UAAttributeId.DataType)
                });

            // Display results.
            foreach (ValueResult valueResult in valueResultArray)
            {
                Console.WriteLine();

                if (valueResult.Succeeded)
                {
                    Console.WriteLine($"Value: {valueResult.Value}");
                    var dataTypeId = valueResult.Value as UANodeId;
                    if (!(dataTypeId is null))
                    {
                        Console.WriteLine($"Value.ExpandedText: {dataTypeId.ExpandedText}");
                        Console.WriteLine($"Value.NamespaceUriString: {dataTypeId.NamespaceUriString}");
                        Console.WriteLine($"Value.NamespaceIndex: {dataTypeId.NamespaceIndex}");
                        Console.WriteLine($"Value.NumericIdentifier: {dataTypeId.NumericIdentifier}");
                    }
                }
                else
                    Console.WriteLine($"*** Failure: {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
        }
    }
}
Inheritance Hierarchy

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

Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also