Connectivity Software User's Guide and Reference
KEPServerEX Method
Example 



OpcLabs.EasyOpcUAPrimitives Assembly > OpcLabs.EasyOpc.UA.AddressSpace Namespace > UANodeId Class : KEPServerEX Method
The string identifier of the custom node in KEPServerEX.

The value of this parameter cannot be null (Nothing in Visual Basic).

Constructs a node Id for the KEPServerEX/UA namespace, given a string identifier of the node.
Syntax
'Declaration
 
<JetBrains.Annotations.MustUseReturnValueAttribute()>
<JetBrains.Annotations.NotNullAttribute()>
<JetBrains.Annotations.PureAttribute()>
Public Shared Function KEPServerEX( _
   ByVal stringIdentifier As String _
) As UANodeId
'Usage
 
Dim stringIdentifier As String
Dim value As UANodeId
 
value = UANodeId.KEPServerEX(stringIdentifier)
[JetBrains.Annotations.MustUseReturnValue()]
[JetBrains.Annotations.NotNull()]
[JetBrains.Annotations.Pure()]
public static UANodeId KEPServerEX( 
   string stringIdentifier
)
[JetBrains.Annotations.MustUseReturnValue()]
[JetBrains.Annotations.NotNull()]
[JetBrains.Annotations.Pure()]
public:
static UANodeId^ KEPServerEX( 
   String^ stringIdentifier
) 

Parameters

stringIdentifier
The string identifier of the custom node in KEPServerEX.

The value of this parameter cannot be null (Nothing in Visual Basic).

Return Value

Returns a node Id for the node in the KEPServerEX/UA specified by the stringIdentifier.

Because there is an implicit conversion from UANodeId to OpcLabs.EasyOpc.UA.UANodeDescriptor, in languages that support implicit conversion operators (such as C# or VB.NET), you can simply use the returned UANodeId in any place where the OpcLabs.EasyOpc.UA.UANodeDescriptor is expected as input, and the corresponding node descriptor will be constructed automatically.

Also, because the UANodeId has an implicit conversion to System.String, and it converts to the expanded text of the node Id (ExpandedText), in languages that support implicit conversion operators (such as C# or VB.NET), you can simply use the returned UANodeId in any place where expanded text of a node Id (a string) is expected as input, and the corresponding expanded text will be taken automatically from the node Id.

This method never returns null (Nothing in Visual Basic).

This return value of this method should not be ignored.

Remarks

This method constructs a node Id with namespace URI "KEPServerEX", and a string identifier given by stringIdentifier. Node Ids in this form are used for nodes specific to the KEPServerEX/UA and its configuration.

The KEPServerEX/UA node Ids are not special in any way, and you can always construct them using the same approaches as with other OPC UA servers. This method just provides a shortcut to constructing KEPServerEX/UA node Ids easily, without having to remember and repeat the namespace URI string used in them.

In KEPServerEX OPC UA namespace, the stringIdentifier is identical to the item ID of the same node in OPC Data Access. Example: "Data Type Examples.16 Bit Device.K Registers.Long1".

This method is pure, i.e. it does not have observable side effects.

This method or property does not throw any exceptions, aside from execution exceptions such as System.Threading.ThreadAbortException or System.OutOfMemoryException.

OPC UA node Id, represented by the UANodeId class, directly identifies a node in a server's address space.

Example
// This KEPServerEX/UA example shows how to read and display data of an attribute (value, timestamps, and status code).
//
// Find all latest examples here: https://www.doc-that.com/files/onlinedocs/OPCLabs-ConnectivityStudio/Latest/examples.html .
// OPC client and subscriber examples in C# on GitHub: https://github.com/OPCLabs/Examples-ConnectivityStudio-CSharp .
// Missing some example? Ask us for it on our Online Forums, https://forum.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.EasyOpc.UA;
using OpcLabs.EasyOpc.UA.AddressSpace;
using OpcLabs.EasyOpc.UA.OperationModel;

namespace UADocExamples.Specialized
{
    partial class Kepware_KEPServerEX_UA
    {
        public static void Read()
        {
            UAEndpointDescriptor endpointDescriptor = "opc.tcp://localhost:49320";  // default KEPServerEX/UA endpoint 

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

            // Obtain attribute data. By default, the Value attribute of a node will be read.
            UAAttributeData attributeData;
            try
            {
                attributeData = client.Read(endpointDescriptor,
                    // The UANodeId.KEPServerEX(...) helper method simplifies creation of node IDs for KEPServerEX/UA nodes.
                    UANodeId.KEPServerEX("Simulation Examples.Functions.Random1"));
            }
            catch (UAException uaException)
            {
                Console.WriteLine($"*** Failure: {uaException.GetBaseException().Message}");
                return;
            }

            // Display results
            Console.WriteLine($"Value: {attributeData.Value}");
            Console.WriteLine($"ServerTimestamp: {attributeData.ServerTimestamp}");
            Console.WriteLine($"SourceTimestamp: {attributeData.SourceTimestamp}");
            Console.WriteLine($"StatusCode: {attributeData.StatusCode}");
        }
    }
}
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

Reference

UANodeId Class
UANodeId Members
OPC UA Node IDs
Namespace indices in OPC UA Node Ids