OPC Studio User's Guide and Reference
OpcLabs.EasyOpc.UA.AddressSpace.Standard Namespace
Inheritance Hierarchy
OpcLabs.EasyOpcUA Assembly : OpcLabs.EasyOpc.UA.AddressSpace.Standard Namespace
This namespace contains classes for standard OPC-UA address space.
Classes
 ClassDescription
ClassA class that declares constants for browse names in the Model Design.
ClassA class that declares constants for all Data Types in the Model Design.
ClassA class that declares constants for all Methods in the Model Design.
ClassA class that declares constants for Objects in the Model Design.
ClassA class that declares constants for Object Types in the Model Design.
ClassA class that declares constants for Reference Types in the Model Design.
ClassA class that declares constants for all Variables in the Model Design.
ClassA class that declares constants for all Variable Types in the Model Design.
Remarks

 

QuickOPC-UA provides static classes with standard Node IDs defined by OPC Foundation: UADataTypeIdsUAMethodIdsUAObjectIdsUAObjectTypeIdsUAReferenceTypeIdsUAVariableIds, and UAVariableTypeIds. You can use properties of these static classes to easily specify “well-known” nodes you need to refer to, for example, the “ObjectsFolder” node which is a common starting node for browsing.

There are following classes with standard Node IDs for OPC-UA:

When you need to pass a standard node to any method, simply use the corresponding property from the static class, such as UAObjectIds.ObjectsFolder.

You can use the command-line OpcCmd Utility (installed with QuickOPC, or downloadable separately) to:

  • Get standard name that corresponds to OPC UA Node Id
  • Get the OPC UA Node Id that corresponds to given standard name
  • Display tables of node IDs and their standard names
  • Filter the tables to find out matching names.

See Using OpcCmd Utility for Static OPC UA Operations.

.NET

// This example shows how to read the build information of the server.
// See also: https://reference.opcfoundation.org/Core/Part5/v105/docs/7.7 and
// https://reference.opcfoundation.org/Core/Part5/v104/docs/12.4 .
//
// 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.Standard;
using OpcLabs.EasyOpc.UA.OperationModel;

namespace UADocExamples.InformationModel
{
    partial class BuildInfoType
    {
        public static void Main1()
        {
            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. By default, the Value attributes of the nodes will be read.
            var readArgumentsArray = new[]
            {
                new UAReadArguments(endpointDescriptor, UAVariableIds.ServerStatusType_BuildInfo_BuildDate),
                new UAReadArguments(endpointDescriptor, UAVariableIds.ServerStatusType_BuildInfo_BuildNumber),
                new UAReadArguments(endpointDescriptor, UAVariableIds.ServerStatusType_BuildInfo_ManufacturerName),
                new UAReadArguments(endpointDescriptor, UAVariableIds.ServerStatusType_BuildInfo_ProductName),
                new UAReadArguments(endpointDescriptor, UAVariableIds.ServerStatusType_BuildInfo_ProductUri),
                new UAReadArguments(endpointDescriptor, UAVariableIds.ServerStatusType_BuildInfo_SoftwareVersion),
            };
            ValueResult[] valueResultArray = client.ReadMultipleValues(readArgumentsArray);

            // Display results.
            for (int i = 0; i < valueResultArray.Length; i++)
            {
                UAReadArguments readArguments = readArgumentsArray[i];
                ValueResult valueResult = valueResultArray[i];
                if (valueResult.Succeeded)
                    Console.WriteLine($"{readArguments.NodeDescriptor.NodeId}: {valueResult.Value}");
                else
                    Console.WriteLine($"{readArguments.NodeDescriptor.NodeId}: *** Failure: {valueResult.ErrorMessageBrief}");
            }
            
            // Note that as of time of writing this code, the public sample server does not have the build information
            // filled in, and the displayed information is thus largely empty (but correct). The example gives better
            // results with servers that provide meaningful build information.
        }
    }
}

 

See Also

Reference

OpcLabs.EasyOpcUA Assembly