QuickOPC User's Guide and Reference
Isolated Property (EasyUAClient)
Example 



OpcLabs.EasyOpcUA Assembly > OpcLabs.EasyOpc.UA Namespace > EasyUAClient Class : Isolated Property
Specifies that you wish that the EasyUAClient object instance works with an "isolated" connection to the OPC-UA server, i.e. one that is not shared with other instances.
Syntax
'Declaration
 
<DefaultValueAttribute(False)>
Public Property Isolated As Boolean
'Usage
 
Dim instance As EasyUAClient
Dim value As Boolean
 
instance.Isolated = value
 
value = instance.Isolated
[DefaultValue(false)]
public bool Isolated {get; set;}
[DefaultValue(false)]
public:
property bool Isolated {
   bool get();
   void set (    bool value);
}
Example
// This example shows how to create and use two isolated client objects, resulting in two separate connections to the target
// OPC UA server.

using System;
using System.Diagnostics;
using OpcLabs.EasyOpc.UA;
using OpcLabs.EasyOpc.UA.OperationModel;

namespace UADocExamples._EasyUAClient
{
    class Isolated
    {
        public static void Main1()
        {
            UAEndpointDescriptor endpointDescriptor =
                "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer";
            // or "http://opcua.demo-this.com:51211/UA/SampleServer" (not in .NET Standard)
            // or "https://opcua.demo-this.com:51212/UA/SampleServer/"

            // Instantiate the client objects and make them isolated
            var client1 = new EasyUAClient { Isolated = true };
            var client2 = new EasyUAClient { Isolated = true };

            // The callback is a local method the displays the value
            void DataChangeCallback(object sender, EasyUADataChangeNotificationEventArgs eventArgs)
            {
                Debug.Assert(!(eventArgs is null));

                Console.Write($"[{eventArgs.Arguments.State}] ");
                if (eventArgs.Succeeded)
                {
                    Debug.Assert(!(eventArgs.AttributeData is null));
                    Console.WriteLine(eventArgs.AttributeData.ToString());
                }
                else
                    Console.WriteLine("*** Failure: {0}", eventArgs.ErrorMessageBrief);
            }

            Console.WriteLine("Subscribing...");
            client1.SubscribeDataChange(endpointDescriptor, "nsu=http://test.org/UA/Data/ ;i=10853", 1000, 
                DataChangeCallback, state: 1);
            client2.SubscribeDataChange(endpointDescriptor, "nsu=http://test.org/UA/Data/ ;i=10853", 1000,
                DataChangeCallback, state: 2);

            Console.WriteLine("Processing data change events for 10 seconds...");
            System.Threading.Thread.Sleep(10 * 1000);

            Console.WriteLine("Unsubscribing...");
            client1.UnsubscribeAllMonitoredItems();
            client2.UnsubscribeAllMonitoredItems();

            Console.WriteLine("Waiting for 2 seconds...");
            System.Threading.Thread.Sleep(2 * 1000);
        }
    }
}
Requirements

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

See Also

Reference

EasyUAClient Class
EasyUAClient Members