BodyGuard
This library is a wrapper for the B&R AsGuard library. BodyGuard is used to detect and validate licenses on a technology guard. BodyGuard is primarily used inside of libraries that require a license. Loupe uses this functionally for validating licenses for OMJSON and Synchro.
tgProtect Function Block
Direction | Name | Type | Description |
---|---|---|---|
In | productCode | UDINT | Product code pulled off of the technology guard. |
In | orderNumber | STRING[255] | Short ID information pulled off of the technology guard. |
In | description | STRING[255] | Description pulled off of the technology guard. |
In | reaction | DWORD | Response to licence violation. |
In | allowSimulation | BOOL | Boolean that specifies if the license is required in simulation. |
Out | status | UINT | Error ID associated with cause of error. |
Out | licenseRegistered | BOOL | Output to signify whether or not the license has been acknowledge previously on the CPU. |
Out | licenseOk | BOOL | Boolean set when the license is validated. |
Out | availableLicenses | UDINT | Number of licenses avail on the B&R dongle. |
Out | neededLicenses | UDINT | Number of licenses required. |
Out | licenseIdent | UDINT | Ident of the license to be registered. |
Reaction Options
- guardLIC_REACT_NONE - No response
- guardLIC_REACT_LOGBOOK - Logbook entry
- guardLIC_REACT_BLINK_CPU_LED - Blinking User LED
- guardLIC_REACT_BOOT_SERVICE - Starts in service mode if the licensing violation occurs during booting
- guardLIC_REACT_SERVICE - Switches to service mode
Usage
//declare an instance of the function block
static struct tgProtect protect;
plcbit checkTG() {
//Set productCode, orderNumber, description, and reaction before calling function.
protect.productCode = 22790;
strcpy(protect.orderNumber, "1TGC.999999.demo");
strcpy(protect.description, "This is an example of a product description");
protect.reaction = guardLIC_REACT_LOGBOOK; //This will report any license discrepancies to the logger
protect.allowSimulation = 1;
//Call function to validate provided license information
tgProtect(&protect);
return protect.licenseOk;
}
Errors
For more error information please see the Automation Studio Help.
- 0 - No error
- 65534 - Function block is not enabled.
- 65535 - Function block is busy.
- 37300 - A null pointer was transferred.
- 37301 - A general error occurred.
- 37302 - Buffer for array is too small to hold all entries.
- 37303 - Not enough memory.
- 37304 - General error preventing function block action from starting.
- 37305 - Error accessing license.
- 37306 - License violation.
- 37307 - Service mode caused by license violation.
- 37308 - Could not create context data.
- 37310 - License update unsuccessful.
- 37311 - File not found.
- 37312 - Invalid license ident.
- 37313 - General error.
- 37314 - Specified B&R dongle not found.
- 37315 - Context size too large.
- 37316 - Invalid parameter.
- 37317 - Unsupported access to license.
- 37321 - Invalid user array data size.