Is It Possible to Query the NI Licenses Information Programmatically?

Updated Dec 18, 2024

Reported In

Software

  • License Manager

Issue Details

  • I want to check if one or several NI software components are already activated with the NI License Manager programmatically, is this possible?
  • My PC pulls licenses from a license server like NI Volume License Manager (VLM). Does VLM have an API that allows me to query the checked out seats?
  • Is there API for NI License Manager or NI VLM?

Solution

NI License Manager and VLM do not have API that query license information or status. To programmatically obtain license information, the following options can be considered.

 

Querying License Status From NI License Manager

To check if a software component is licensed locally:

  • Use LabVIEW Error Handling to determine if an installed software component is activated.
    • For example, manual error handling can be used to identify which specific errors are thrown when using an unlicensed NI software component. If a VI is using an unlicensed toolkit or module, calling the VI dynamically will throw an error if it is unlicensed.
  • Develop code that parses the local license files in C:\ProgramData\National Instruments\License Manager\Licenses to identify if a specific NI software component is already activated.
    • For example, the code may check if the license file related to a specific software component is present on the PC. Then, the code can parse the file to check if the expiration date occurs in the future.
    • The image below is an example of a local license file for LabVIEW, which expires on July 11th 2025.

 

LV License.PNG

 

Querying Seat Usage From NI VLM

To programmatically check the usage of a network license, develop code that parses the lmgrd.log file in C:\ProgramData\National Instruments\License Manager\Data on the license server PC. This file is a log of all license usage and contains information about when a license is consumed by a client and when it is returned to the server.

The image below shows an example of the lmgrd.log contents. It consists of entries formatted as <Timestamp> (nilim) <OUT or IN>: "<Product Name>" <related client PC>. For example:

14:14:30 (nilm) OUT: "LabVIEW_Pro" ClientSystemA

15:14:30 (nilm) IN: "LabVIEW_Pro" ClientSystemA

15:15:00 (nilm) OUT: "LabVIEW_Pro" ClientSystemB

 

lmgrd.png

Additional Information

The Command Line Interfaces (CLIs) for NI License Manager and NI VLM do not obtain information about the license activation status or seat usage: