License check
General information
In case of a chargeable app, a license check should be integrated into the app. The license check verifies the presence of a license on the device or on a LIC SD card located in the device.
The license must first be purchased by the customer and then transferred to the device or LIC SD card by the customer.
It is recommended that an app can be used for about an hour without a license. This allows interested customers to carry out a basic test with your app. After this hour, you decide how your app should behave if the license check returns a negative result. If there is no license on the device, execution can be prevented or restricted.
Firm code and product code
A firm code and a product code are required to carry out the license check.
Both pieces of information are app-individual. Both pieces of information are provided as "App Identifier" by the PLCnext Store.
You will find the "App Identifier" on the Core Date tab from your app. The "App Identifier" is a combination of firm code and product code.
The first seven numbers represent the firm code and the last seven numbers represent the product code.
Example:
App identifier: 60002172990355
Firm code: 6000217
Product code: 2990355
License check in high-level language software
For this purpose protecting your app the following RSC service is available:
Arp::System::Lm::Services::ILicenseStatusService::GetLicenseStatus(uint32 firmCode, uint32 productCode, uint32 featureCode=0)
C++ declaration
boolean GetLicenseStatus(uint32 firmCode, uint32 productCode, uint32 featureCode)
C# declaration
bool GetLicenseStatus(UInt32 firmCode, UInt32 productCode, UInt32 featureCode)
GrpcUrl
./grpcurl -d '{"firmCode": "0","productCode":"0","featureCode":"0"}' -plaintext -unix /var/run/plcnext/grpc.sock Arp.System.Lm.Services.Grpc.ILicenseStatusService/GetLicenseStatus
See the RSC documentation reference in the main PLCnext Technology Info Center. This function is integrated in the application via the static library "lib.Arp.System.Lm.Services.a" which is included in the PLCnext Technology Software Development Kit.
License check in IEC 61131 projects or libraries
We offer the function block LICENSE_STATUS to protect a PLCnext Engineer project or library. The function block LICENSE_STATUS is available in the software PLCnext Engineer in the PLCnext Controller library. The library PLCnext Controller is not loaded by default. You must first add it in the COMPONENT area via Add Library....
Add the firm code and product code to the function block LICENSE_STATUS.
When starting the app, the license status should be checked once. Further checks at runtime can also be carried out, but the status should not be polled at short intervals to avoid unnecessary system load. The app must not crash, even if no valid license is (yet) installed on the device. This is a normal state. In this case, we recommend that the app runs in a trial mode, which allows a limited user trial.