Promotic

PmLicServer licence server

PmLicServer licence server is included in the installation package of PROMOTIC 9. PmLicServer licence server allows to provide the licences to PROMOTIC applications either locally or via network. This way, it is not necessary to have licence in its own HW Key for each individual PROMOTIC application. This licencing procedure can also solve problems in the PROMOTIC application running in virtualized environment, where the PROMOTIC application cannot access the physical HW Key connected to USB port. PmLicServer licence server is typicaly automatically launched on computer boot as a service of the OS Windows.

In order to assure correct functionality it is necessary, that the computers with PROMOTIC applications (licence clients) have network connectivity via the HTTP or HTTPS protocol to the computer with the PmLicServer licence server program. The communication between PROMOTIC application and the licence server happens not only when the application is launching, but also after that, repeatedly periodically (the period is around 1 minute or or slightly longer). The network connection with the licence server must be functional during the whole time the PROMOTIC application is running.

The licences on the licence server are so-called "floating": The PROMOTIC applications can be launched on any PC (connected to the network) but the number of simultaneously running applications can not exceed the number of runtime licences present on the licence server. If, For example, there are 2 runtime licences present on the licence server, then it is possible to run 2 applications simultaneously. Additional application (third) can not be launched. If one of the running applications is stopped and thus does not communicate with the licence server for 10 minutes, then its licence is released on the licence server and available to be used by another application. Now it is possible to run the other application - it will use this released licence.

Local mode for licence carriers hwkey and swkey

In this mode the PmLicServer licence server is not protected (licenced) by its own hardware key. The licence server provides locally licences to PROMOTIC applications from carriers hwkey and swkey (.SWK file).
For licence carriers swkey, the access via the licence server is mandatory, i.e. the PROMOTIC application cannot read such licence directly.
For licence carriers hwkey, the access via the licence server is optional, i.e. the PROMOTIC application can access such licence directly. The main advantage of accessing the hardware key licence via the local Licence server is in the Remote Desktop mode of Windows. In this (RDP) mode, the licence server service can access the hardware key, while the direct access of the PROMOTIC application is not possible. The licence server periodically reads all available hardware keys and provides the licence content of such keys as it was obtained during the last periodical reading.
Setup example of Licence server not protected by its hardware key (local mode):
[Config]
Medium=none

Network mode for licence carriers netkey

In this mode the PmLicServer licence server is protected by its own hardware key, where the HW Key number must be defined in the configuration file PmLicServer.ini. The presence of the HW Key is periodically checked. The licence server provides PROMOTIC applications with licences via network from netkey carriers (.SWK file). The network licence carried by netkey (.SWK file) is generated for specific licence server protected by a hardware key. The licence will not be accepted by PROMOTIC application if the licence server is not configured properly or the hardware key is missing or has invalid number.
Setup example of Licence server protected by its hardware key 1234 (network mode):
[Config]
Medium=hwkey:k1234

Installation, uninstallation of the licence server and service configuration

The program is a part of the PROMOTIC installation and can be installed individually on the computer designated to be a licence server. The PmManager can be used to configure the PmLicServer licence server so it is launched automatically as OS Windows as service at computer start. The PmLicServer licence server service can be configured, stopped and launched by using the standard OS Windows resources (services.msc service manager).

The program (service) can also be controlled from the command line by entering parameters. The command line window must be launched with the Administrator rights. The commands are relevant in some special cases for example in OS Windows *.bat files. Usually it is not necessary to use such commands because the OS Windows service is configured during the program installation process and it is removed when the program is uninstalled. The configuration, stopping and launching is provided by using the standard OS Windows resources. Individual commands:
 
PmLicServer -i - Adds the OS Windows service for the PmLicServer licence server program. The service will be configured in order to launch automatically on system boot. It is done automatically during the program installation.
PmLicServer -u - Removes the OS Windows service of the PmLicServer licence server program. It is done automatically during the program uninstallation.
PmLicServer -s - Launches the OS Windows service of the PmLicServer licence server program.
PmLicServer -k - Stopps the OS Windows service of the PmLicServer licence server program.
PmLicServer - Launches the PmLicServer licence server program as a normal application, not as a service. Application icon appears in the OS Windows Sys Tray among icons on the right. This can be handy for testing purposes.

Licence server configuration

The program is configured via the PmLicServer.ini configuration file. This file is created automatically during the installation and is located in the \GCfg folder.
Description of the keys in the [Config] section:
 
WebServer - The key allows to modify the port and protocol (HTTP or HTTPS) that will be used for listening by the internal Web server of the PmLicServer licence server program. If not set, then the default value http://+:5656/ is used, it means that the HTTP protocol on port 5656 is used. The ";" character at the beginning of the line changes it to a comment. Such line is not taken into account.
Example1:
Example of the PmLicServer.ini configuration file for the HTTP protocol, localhost, and port 5656. For the licence server working only in local mode, it is handy for safety reasons to limit the Web server listening only on localhost interface (127.0.0.1 or ::1).
[Config]
WebServer=http://127.0.0.1:5656/
Example2:
Example of the PmLicServer.ini configuration file for the HTTP protocol and port 81
[Config]
WebServer=http://+:81/
Example3:
Example of the PmLicServer.ini configuration file for the HTTPS protocol and default port 443
[Config]
WebServer=https://+:443/
 
LogRefresh - This key defines whether the information regarding client licence refersh is written into the Log file. The 1 value enables writing, the 0 value disables writing (default logging period is 1 minute for each client). This may be useful for debugging problems with network licences but from long term point of view, periodically logging this information may overwrite other important logs from the circular log file(s). If not set, then the logging of licence client refresh into the Log file is disabled (the 0 value).
Example:
Example of the PmLicServer.ini configuration file that enables logging of periodical client licence refresh into the Log file
[Config]
LogRefresh=1
 
Medium - Key specifies whether the licence server will be running in local or network mode.
hwkey:none (default) - Local mode. Only for reading hwkey and swkey licence carriers from local computer (the application and the licence server must be on the same PC).
hwkey:k1234 - Network mode with hardware key protecting the licence server. The netkey licence carriers can be accessed via network. The hwkey and swkey licence carriers can only be accessed from local computer (the application and the licence server must be on the same PC).
Example:
Example of the PmLicServer.ini configuration file for setting the specific HW Key with number 1234 for protection of the licence server (in network mode).
[Config]
Medium=hwkey:k1234


Commissioning the HTTPS protocol of the licence server:
The implementation of the licence server (Web server) is provided by the OS Windows "HTTP service". The configuration of HTTPS protocol is done axactly the same way, as for the HTTPS protocol of the PmaWeb object, i.e. by the utility PmHttpConfig.exe (it is necessary to set the rights, import the certificate of the server and connect it with the corresponding Web server).

Monitoring the licence server functionality

The program allows to monitor the current status of provided network licences and also the history of network licence clients logins and logouts. The monitoring is provided via the Web interface. PmLicServer licence server contains an internal Web server, that offers the info.html and log.html pages on it s IP address, protocol and port. For example http://localhost:5656/info.html and http://localhost:5656/log.html.
 
The log file is created automatically in the \GTemp folder.

Behavior of the PROMOTIC application when the connection with the licence server is lost

If the periodic communication with the licence server is permanently failing, or if the connection with licence carrier is lost in general (the hardware key is not accessible for the licence server or for the application), then the running PROMOTIC application goes through the following states:
1) information - first, the error message about the failed communication with the licence server is displayed in global errors. This state is reached after the first failure of the periodical communication. This state lasts around 10 minutes.
2) warning - after that, the warning window is displayed (repeatedly if the user closes it) and in the global errors the licence server communication failure message is displayed. This state lasts around 48 hours.
3) error - finally, the situation is evaluated as fatal error, the application is stopped and licence error message is displayed in the global errors.
 
The states 1) and 2) are immediately terminated after first successfull periodical communication with the licence server or after the licence becomes accessible. If the communication with the licence server fails permanently, then the application is stopped after 48 hours. The method Pm.LicenceInfo(10) for detection of time that has passed since the last successfull communication with the licence server can be used.
 
If the connection to the licence server is not functional or the licence carrier is not accessible then the PROMOTIC application cannot be launched. The time protection interval of the application before it is stopped, because of the licence server communication failure is relevant only for application that are already running.

Commissioning the SWK licence files on the licence server and the licence client

a) Licence server - The licence file it is necessary to copy into the ?:\Promotic\Licences folder.
b) Licence client - In the application INI file (for runtime - PmRt), or in PROMOTIC INI file (for the development environment - PmDev and PmDevSchool) (since version Pm8.3.0) it is necessary to create the section [Licence] and in this section to create the key Medium as described below (reference to a PmLicServer licence server and to a specific Network licence key):
[Licence]
Medium=netkey:http://192.168.1.99:5656/Pm1234.swk
or
Medium=swkey:Pm1234.swk
 
, where the netkey indicates the network licence, http or https specifies the protocol, followed by the IP address or computer name, internal Web server port and the licence SWK file name.

Caution:
 
Logged-in Windows user must have the permissions for writing into following files:
- app.ini files of PROMOTIC application bound to PmLicServer licence server

Accessing licences contained in a hardware key via the local licence server:

Recommended for usage with remote desktop (RDP). PROMOTIC system and Windows remote desktop (RDP).
 
PmLicServer.ini:
Configuration file PmLicServer.ini - PmLicServer licence server
[Config]
Medium=none
Application ini file:
[Licence]
UseLicServerHwk=1
Medium=hwkey:k1234

History:
Pm9.00.09: Running the licence server in local mode for licence carriers hwkey and swkey.
Pm9.00.03: Renamed and modified licence server.
In previous versions, the licence server name was PmNetKey.exe and was available as independent program for installation.
Now it is named PmLicServer.exe and is included in the installation of each corresponding PROMOTIC version (it is possible to select only the installation of PmLicServer in the install options).
Pm8.03.23: Extension of runtime period while connection to licence server is lost from 12 hours to 48 hours
Pm8.02.00: Created
PROMOTIC 9.0.18 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.