getLicenseOption()

The function getLicenseOption() allows you to query the current license and obtain a license from a license container.

Synopsis

int getLicenseOption(string option, [unsigned count]);

Parameters

Parameters Meaning
option Name of a WinCC OA License option (feature) or a customer-specific keyword* you want to query:

See chapter WinCC OA License options (Features)

count Number of licenses you request. The NumberOfItems can be higher, the same or lower than the current license. If the NumberOfItems is higher than the license, the function returns the maximum possible number of licenses.

Return Value

The function returns the current number of granted licenses or the maximum possible number of licenses if too many licenses are requested. The function returns 0 if no license is available and -1 in case of parameter errors.

Description

The function getLicenseOption() allows you to query the current license and obtain a license from a license container.

With the first parameter "licenseOption" you query the current number of granted licenses the client knows from the initialization or from previous requests.

With the second parameter "NumberOfItems" you request the "NumberOfItems" of licenses of the parameter "licenseOption".

*The "custom_keyword" is automatically queried by the event manager when it is started if it is available. Your customer-specific content is then available for all inquiries but cannot be requested or returned separately as the general options.

Example

The example requests two licenses for "ui" and outputs the number of granted licenses.

main(mapping event)
{
  int numbReq;
  numbReq = getLicenseOption("ui", 2);
  DebugN("Number of granted UI licenses:", numbReq);
  }

The example queries the number of licenses for the feature "myFeature" and outputs the number of licenses.

main(mapping event)
{
  int numbReq;
  numbReq = getLicenseOption("myFeature");
  DebugN("Number of licenses:", numbReq);
}

Assignment

Licensing

Availability

UI, CTRL