This document provides the steps that you can use in order to automatically and silently activate NI Licenses (such as NI Vision Run-Time License, etc...) as part of the BLT activation process for your LabVIEW application.
In order to do this, we create a new BLT Product Feature where we will store the NI License keys for each of your end-user. Then, we will use the BLT for LabVIEW API in order to retrieve those License Keys and programmatically activate NI products using the command line utility: nilmUtility.exe
This procedure has been validated with NI License Manager version 3.x
Note that this procedure can be adapted to NI License Manager version 4.x. For more information, make sure NI License Manager 4.x is installed on your computer and run the following command in a CMD window:
"C:\Program Files (x86)\National Instruments\Shared\License Manager\NILicensingCmd.exe" /help
However, NI License Manager 4.x requires that you are previously logged in with your NI Account before you can perform a silent activation. National Instruments currently doesn't provide any way to automate this login process!
1. Create a new BLT Product Feature
- Select your product in the list
- Click on the "Configure Product Attributes" button
- Select the "Features" tab and click on the "Add" button
- Remember the Product Feature ID (top left) since we will need it later when using the BLT API.
- Click "Save" and close the Product Attributes dialog.
2. Define the NI License Keys for your end-users using Product Feature Permissions
- Select one or more Licenses in the list and click on the "Configure Product Feature permissions" button
- Drag and Drop your Product Feature "NI Licenses" from the left to the right in order to give permissions to this BLT Product Feature
- Select your Product Feature "NI Licenses" from the list of "Product Features with permissions" and click on the "Set Attributes Values" button
- For each NI License to activate (that you previously defined in step 1.), specify the NI License Key to use for activation
- Click "OK" to validate your changes
- Click "Apply" to save your changes for the selected License(s)
3. Use the BLT API for LabVIEW and programmatically activate NI Licenses
- See the Block Diagram below to learn how to programmatically activate NI Licenses. This code uses the "GetLicenseDetails.vi" and "GetFeatures.vi" VIs from the BLT API palette in order to retrieve the end-user's name and its associated NI Licenses serial numbers as defined in step 2. Then we programmatically call the nilmUtility.exe command-line tool to process the activation against NI Servers. (See here for more details: http://zone.ni.com/reference/en-XX/help/371136G-01/nilm/html/automating/)
- The "NI Licenses Feature ID" constant value must match the ID of the Product Feature that you defined in step 1.
- This VI can be downloaded from this post. It is saved for LabVIEW 2010
4. Activate NI Licenses as part of the BLT Activation process
This step must be performed only after you have successfully configured the BLT Build Specifications for your product. See here for more information.
- Locate the BLT_Main VI for your application. This VI can be found on the block diagram of the STARTUP_VI created by BLT for your application
- Show the Block Diagram for the BLT_Main vi and make sur you can edit it
- This block diagram looks like a State Machine. Locate the "Activation: Authenticate" case of the this state machine
- Display the "False" case of the case structure located in "Activation: Authenticate" subdiagram
- Insert the VI created in step 3. as shown below: