QuickOPC User's Guide and Reference
Licensing Elements
Application Deployment > Licensing Elements
In This Topic

License Location

The QuickOPC license is located in a license store. The following table lists the license stores available under each development platform, and their search order.

Search Order License Store Type COM .NET Framework .NET 6+ Python Excel (with Excel Option)
1. File License Store

2. Managed Resource License Store

(1)

3. Registry License Store

(Windows only)

4. Built-in License Store (trial license only)

Note (1): The manage resource license store actually works from Python, but is impractical/of little benefit to use.

 

QuickOPC attempts to find a valid license in the available license stores, using a pre-set search order as given above (from top to bottom). If a valid license is found, it is used. If it is not found, the search proceeds to the next available license store. There is always a valid trial license available in the Built-in License Store. This is the one that will be used if everything else fails.

The File License Store allows the license be placed in a file that resides in the file system, usually next to the main program executable.

The Managed Resource License Store allows you to embed the license directly within your application (in a .NET assembly). This method cannot be used on the COM platform. Its advantage is that it does not require any further actions during deployment.

With the Registry License Store, proper license (for runtime usage) must be installed on the target computer (the computer where the product will be running). The License Manager utility (GUI or console-based) is normally needed for this. The GUI-based License Manager is contained in the LicenseManager.exe file. The console-based License Manager is contained in the LMConsole.exe file. Both files are located under the Bin subdirectory of the product. Alternatively, you can write an installation program that installs the license into the Registry License Store automatically. The Registry License Store is not available on the .NET 6+ development development platform.

The fact that you have used a valid QuickOPC license in the Registry License Store during development and building of your application does not mean that the resulting application will automatically be licensed on a different computer. You must do the extra steps described in this documentation (depending on the license store chosen) in order to assure that your deployed application is licensed in runtime.

License Verification

If the proper license is not installed, you will end up with the trial license being used instead, as described above. That is usually manifested by the fact that after 30 minutes of the process run time, the component stops delivering valid data and gives an error instead.

Of course, you might want to know and verify sooner whether the license you intended to use has been found, validated and used. You can do so from your program by inspecting the elements of the dictionary returned from the LicenseInfo Property on the EasyXXClient object. The dictionary is keyed by strings, and you can obtain various information related to the license from it. If you simply want to verify that the right license is in use, we suggest that you test its serial number, either by excluding a range for demo and trial licenses (as in the following example), or by requiring that the serial number of the license in use is equal to the precise serial number of your license. You obtain the serial number by getting the "Multipurpose.SerialNumber" element of the dictionary. The license key file you obtained when you purchased QuickOPC has your serial number as its first series of digits.

The example below shows how to obtain the serial number of the active license, and determine whether it is a demo or trial license.

.NET

// Shows how to obtain the serial number of the active license, and determine whether it is a stock demo or trial license.

using System;
using OpcLabs.EasyOpc.UA;

namespace UADocExamples.Licensing
{
    partial class LicenseInfo
    {
        public static void SerialNumber()
        {
            // Instantiate the client object.
            var client = new EasyUAClient();

            // Obtain the serial number from the license info.
            long serialNumber = (uint)client.LicenseInfo["Multipurpose.SerialNumber"];

            // Display the serial number.
            Console.WriteLine("SerialNumber: {0}", serialNumber);

            // Determine whether we are running as demo or trial.
            if ((1111110000 <= serialNumber) && (serialNumber <= 1111119999))
                Console.WriteLine("This is a stock demo or trial license.");
            else
                Console.WriteLine("This is not a stock demo or trial license.");
        }
    }
}
# Shows how to obtain the serial number of the active license, and determine whether it is a stock demo or trial license.

# The QuickOPC package is needed. Install it using "pip install opclabs_quickopc".
import opclabs_quickopc

# Import .NET namespaces.
from OpcLabs.EasyOpc.UA import *


# Instantiate the client object.
client = EasyUAClient()

# Obtain the serial number from the license info.
serialNumber = client.LicenseInfo.get_Item('Multipurpose.SerialNumber')

# Display the serial number.
print('SerialNumber: ', serialNumber, sep='')

# Determine whether we are running as demo or trial.
if (1111110000 <= serialNumber) and (serialNumber <= 1111119999):
    print('This is a stock demo or trial license.')
else:
    print('This is not a stock demo or trial license.')

print()
print('Finished.')
' Shows how to obtain the serial number of the active license, and determine whether it is a stock demo or trial license.

Imports OpcLabs.EasyOpc.UA

Namespace Licensing
    Friend Class LicenseInfo
        Public Shared Sub SerialNumber()

            ' Instantiate the client object.
            Dim client = New EasyUAClient()

            ' Obtain the serial number from the license info.
            Dim serialNumber As Long = CUInt(client.LicenseInfo("Multipurpose.SerialNumber"))

            ' Display the serial number.
            Console.WriteLine("SerialNumber: {0}", serialNumber)

            ' Determine whether we are running as demo or trial.
            If (1111110000 <= serialNumber) And (serialNumber <= 1111119999) Then
                Console.WriteLine("This is a stock demo or trial license.")
            Else
                Console.WriteLine("This is not a stock demo or trial license.")
            End If
        End Sub
    End Class
End Namespace

.NET

// Shows how to obtain the serial number of the active license, and determine whether it is a stock demo or trial license.

class procedure LicenseInfo.SerialNumber;
var
  Client: _EasyUAClient;
  SerialNumber: Int64;
begin
  // Instantiate the client object
  Client := CoEasyUAClient.Create;

  // Obtain the serial number from the license info.
  SerialNumber := Int64(client.LicenseInfo['Multipurpose.SerialNumber']);

  // Display the serial number.
  WriteLn('SerialNumber: ', SerialNumber);

  // Determine whether we are running as demo or trial.
  if ((1111110000 <= SerialNumber) and (SerialNumber <= 1111119999)) then
    WriteLn('This is a stock demo or trial license.')
  else
    WriteLn('This is not a stock demo or trial license.');
end;
// This example shows how to obtain nodes under a given node of the OPC-UA address space. 
// Shows how to obtain the serial number of the active license, and determine whether it is a stock demo or trial license.

// Instantiate the client object
$Client = new COM("OpcLabs.EasyOpc.UA.EasyUAClient");

// Obtain the serial number from the license info.
$SerialNumber = $Client->LicenseInfo["Multipurpose.SerialNumber"];

// Display the serial number.
printf("SerialNumber: %s\n", $SerialNumber);

// Determine whether we are running as demo or trial.
if ((1111110000 <= $SerialNumber) and ($SerialNumber <= 1111119999))
    printf("This is a stock demo or trial license.\n");
  else
    printf("This is not a stock demo or trial license.\n");
Rem Shows how to obtain the serial number of the active license, and determine whether it is a stock demo or trial license.

Private Sub LicenseInfo_SerialNumber_Command_Click()
    OutputText = ""
        
    ' Instantiate the client object
    Dim client As New EasyUAClient

    ' Obtain the serial number from the license info.
    Dim serialNumber As Long
    serialNumber = client.LicenseInfo("Multipurpose.SerialNumber")
    
    ' Display the serial number.
    OutputText = OutputText & "Serial number: " & serialNumber & vbCrLf
    
    ' Determine whether we are running as demo or trial.
    If (1111110000 <= serialNumber) And (serialNumber <= 1111119999) Then
        OutputText = OutputText & "This is a stock demo or trial license." & vbCrLf
    Else
        OutputText = OutputText & "This is not a stock demo or trial license." & vbCrLf
    End If
End Sub

 

The example below shows how to display all fields of the available license(s).

// Shows how to display all fields of the available license(s).

using System;
using System.Collections.Generic;
using OpcLabs.BaseLib.Collections.Specialized;
using OpcLabs.EasyOpc.UA;

namespace UADocExamples.Licensing
{
    partial class LicenseInfo
    {
        public static void AllFields()
        {
            // Instantiate the client object.
            var client = new EasyUAClient();

            // Obtain the license info.
            StringObjectDictionary licenseInfo = client.LicenseInfo;

            // Display all elements.
            foreach (KeyValuePair<string, object> pair in licenseInfo)
                Console.WriteLine($"{pair.Key}: {pair.Value}");
        }
    }
}
# Shows how to display all fields of the available license(s).

# The QuickOPC package is needed. Install it using "pip install opclabs_quickopc".
import opclabs_quickopc

# Import .NET namespaces.
from OpcLabs.EasyOpc.UA import *


# Instantiate the client object.
client = EasyUAClient()

# Obtain the license info.
licenseInfo = client.LicenseInfo

# Display all elements.
for pair in licenseInfo:
    print(pair.Key, ': ', pair.Value, sep='')

print()
print('Finished.')

Legal Concerns

Your usage of the software created with elements from QuickOPC must comply with the terms of QuickOPC EULA. In addition, because QuickOPC contains and/or may depend on licensed material from 3rd parties, you must comply with license terms of such material as well. See Licenses for Redistributed Material for more details.

See Also

Examples - Licensing