extLicenseCheck (Function)

Top  Previous  Next

Architecture:

NX32L

Firmware version:

1.80.00


This function will check if a license is present.

 

 

Input:

id : STRING

The license id to check for.

The license id is a text of up to 50 characters, which identifies the license.

 

Returns: INT

1

- The license is present

0

- The function is not available.

-1

- The license is not present

-3

- Generic error.

 

Declaration:

FUNCTION extLicenseCheck : INT;
VAR_INPUT
   id STRING;
END_VAR;

 

 

Example:

 

INCLUDE rtcu.inc
 
FUNCTION ShowLicense;
VAR_INPUT
   id       : STRING;
END_VAR;
VAR
   text     : STRING;
   rc       : INT;
END_VAR;
 
   // Check license
   rc := extLicenseCheck(id := id);
 
   // Build
   CASE rc OF
      1:  str := "Present";
      0:  str := "Not available";
      -1str := "Not present";
      -3str := "Generic error";
   ELSE
      str := strFormat(format := "Unknown \1", v1 := rc);
   END_CASE;
 
   DebugMsg(message := "+------------------------------+");
   DebugMsg(message := "license        : " + str);
 
END_FUNCTION;
 
PROGRAM test;
 
 
   // Show if the license is present
   ShowLicense(id := "example.license");
 
 
END_PROGRAM;