1.3.14. License Management

There are 2 different kind of licensing mechanisms in the runtime system:

  • Device type license:
    A device vendor can license single features for his device. So the license is available on every device of the same type.
  • Single license:
    Single features or some libraries from the CODESYS store are licensed per a single device. This is called single licensing.

Both mechanisms are described now in detail.

1.3.14.1. Device type license

Extra license fees have to be paid for various features of CODESYS. The use of this license is granted per device variant instead of one specific device.

This chapter describes the protection of features that have been licensed for a certain device type.

The check is performed by components which an OEM has already purchased and is to prevent the customer of an OEM from using non-free components on controllers of other manufacturers who have not purchased such components. Furthermore, the license check is to make sure an end user can only work with components which have actually been tested and activated for the device in question.

A working license check needs a license file (3s.dat) which must be part of the controller firmware. It defines which features are activated and also contains the exact ID of the runtime system. So it can only be used on the device in question. The license file is part of the runtime toolkit delivery. It can be found in the folder “Configuration”. The file must be made available in the directory of the runtime system.

For information about how to map the file to different paths, see FilePath_3SDat.

Every single controller type has its own ID consisting of vendor ID and device ID. An OEM can freely define the device IDs for their controllers but needs to register them at 3S to enable 3S to generate the license files.

If the license file is missing or is incorrect, the non-free components will either not run at all or run in a demo mode and the logger will issue an error message. The visualization in demo mode displays a box on the upper right of the screen that identifies the demo mode. The demo mode of the field bus stacks are indicated with an orange icon (instead of the green icon) in the device tree.

This works on components only from CODESYS V3.4 or higher. Devices with an older version of CODESYS which work with non-free components of an older version are not affected by this licensing mechanism

The actual license check takes place at runtime. If OEMs want to prevent that customers using a non-licensed field bus when programming their application, they can do so by making an entry in the device description (see “allowonly” property of a Connector in device description file).

1.3.14.2. OEM licensing

We encourage our customers to let CODESYS GmbH maintain the device variants, as it is much easier to upgrade specific devices to new versions. Additionally it lowers the complexity of maintaining the variants on both sides.

But as this makes only sense to a specific number of variants, we allow our OEM customers to maintain their own device variants if necessary. The sales aspect of such a configuration needs to be cleared first.

Technically this means, that we provide only one delivery, which has a “mask” set, so that the customer can change the device ID, and still use the same 3S.dat licenses.

The device ID can then be changed by overloading the component SysTarget. To overload it, there is a template in the toolkit, named “SysTargetOEM”.

The drawback is, that the end-user can then use every license, which is enabled in the 3S.dat file. But this is not always intended. To enable the OEM customer to decide by himself which license he will enable for his users, there are two possibilities:

  1. Maintain different 3S.dat files. Then the firmware needs to place the active one in the right path, or overload the mapping, if it was mapped like described in FilePath_3SDat.

  2. Mark the licenses as “dynamic”. This feature needs an adaptation, which needs to be done in cooperation of a CODESYS Engineer. Alle licenses, marked as “dynamic” are not directly usable. They need to be enabled by a component in the runtime system.

The drawback of solution (2) is, that it is more complex to implement, and that the user can’t use the demo mode of features, which are not enabled.

1.3.14.3. Single license

Single device type licenses are managed differently from device type licenses. These licenses are bound at a dedicated device and cannot be used on a another device.

For this we use the product “CodeMeter” from WIBU Systems. See the tutorial for detailed information.