PicoOPC User's Guide and Reference
License Key

Without a license key, you are allowed to use PicoOPC for evaluation purposes only. License key is a GUID that you obtain from the PicoOPC vendor.

In your code, you need to set this GUID to the LicenseKey property of every Client object instance you create, before you make any OPC operation on it. Without a valid license key set to this property, PicoOPC operates in a trial mode, and will stop delivering data after 30 minutes. The following example shows how to set the license key from your code.

// This example shows how to set the component's license key.

using System;
using OpcLabs.PicoOpc.UA;

namespace ConsoleApp._Client
{
    class LicenseKey
    {
        public static void Main1()
        {
            // Instantiate the client object, and set its license key.
            var client = new Client
            {
                // Note: This particular license key is just for the demonstration, and isn't actually valid.
                LicenseKey = new Guid("A70DA84C-02B8-4EE6-B9CB-93CBC72B46E5")
            };

            // The remainder of this example is not that relevant, it just reads a node and displays the result.

            try
            {
                try
                {
                    // Connect to the server.
                    Console.WriteLine();
                    Console.WriteLine("Connecting...");
                    client.Connect(new Uri("opc.tcp://opcua.demo-this.com:51210/UA/SampleServer"));

                    // Read a node.
                    Console.WriteLine();
                    Console.WriteLine("Reading...");
                    var nodeId = new NodeId(10221, namespaceIndex:2);
                    DataValue dataValue = client.Read(TimeSpan.Zero, new[] { new ReadValueId(nodeId) })[0];

                    // Display the result.
                    Console.WriteLine();
                    Console.WriteLine($"Status code: 0x{dataValue.StatusCode:X8}");
                    Console.WriteLine($"Server timestamp: {DateTime.FromFileTimeUtc(dataValue.ServerTimestamp)}");
                    Console.WriteLine($"Source timestamp: {DateTime.FromFileTimeUtc(dataValue.SourceTimestamp)}");
                    Console.WriteLine($"Built-in type: {dataValue.Variant.BuiltInType}");
                    Console.WriteLine($"Is array: {dataValue.Variant.IsArray}");
                    Console.WriteLine($"Value: {dataValue.Variant.Value}");
                }
                finally
                {
                    if (client.IsConnected)
                    {
                        // Disconnect from the server.
                        Console.WriteLine();
                        Console.WriteLine("Disconnecting...");
                        client.Disconnect();
                    }
                }
            }
            catch (AggregateException aggregateException)
            {
                Console.WriteLine("*** Failure: {0}", aggregateException.GetBaseException().Message);
            }
        }
    }
}