Configuration of licensing hardware

The following article describes how to configure licensing hardware (e.g. an EL6070 terminal). Essentially, this concerns the selection and configuration of the device in the TwinCAT licensing dialogs.

As a requirement for the following steps, the corresponding licensing hardware must be present in the I/O part of the TwinCAT configuration, e.g. in the case of an EL6070:

Configuration of licensing hardware 1:

Finding all existing licensing devices

A check for all existing licensing hardware can be performed by exporting the XML description to the "License" node of the TwinCAT configuration.

Code snippet (C#):

ItcSmTreeItem license = systemManager.LookupTreeItem("TIRC^License");
string xmlDescription = license.ProduceXml();

Code snippet (Powershell):

$license = $systemManager.LookupTreeItem("TIRC^License");
$xmlDescription = $license.ProduceXml();

The XML description lists the available licensing hardware, for example:

<TreeItem>
  <ItemName>License</ItemName>
  <PathName>TIRC^License</PathName>
  <ItemType>59</ItemType>
  <LicenseDef>
    <AvailableLicenseDevices>
      <LicenseDevice>
        <Name>Term 2 (EL6070)</Name>
        <PathName>TIID^Device 1 (EtherCAT)^Term 1 (EK1100)^Term 2 (EL6070)</PathName>
        <TypeName>EL6070 1Ch. Licensing-Terminal</TypeName>
        <ObjectID>50462722</ObjectID>
      </LicenseDevice>
    </AvailableLicenseDevices>
    <Commands>
      <ActivateResponseFile/>
    </Commands>
  </LicenseDef>
</TreeItem>

Selecting a licensing device

To add licensing hardware to the TwinCAT license configuration, either the device name or its ObjectID can be used. The former is well-suited if the device name is known, e.g. if the I/O device was generated in advance. The latter can be determined from the XML description above.

Code snippet (C#):

ItcSmTreeItem el6070dev1 = license.CreateChild("NameOfDevice", 0, null, "Term 2 (EL6070)"); // DeviceName
ItcSmTreeItem el6070dev2 = license.CreateChild("NameOfDevice", 0, null, "50462722"); // ObjectID

Code snippet (Powershell):

$el6070dev1 = $license.CreateChild("NameOfDevice", 0, $null, "Term 2 (EL6070)"); // DeviceName
$el6070dev2 = $license.CreateChild("NameOfDevice", 0, $null, "50462722"); // ObjectID

System requirements

Required TwinCAT version

TwinCAT v3.1.4022.4