Developer Center Resources

cancel
Showing results for 
Search instead for 
Did you mean: 

Licensing and Distributing a FlexLogger Plugin

FlexLogger Plugin Development Kit – NI Tools Network Supplement

Overview of licensing and distribution

 

Integration with NI License Manager

FlexLogger plugins are built into LabVIEW packed libraries, which helps protect plugin developers’ IP. However, the FlexLogger Plugin Development Kit does not natively include any licensing tools. This section describes an approach to integrating the NI License Manager Third-Party SDK into a FlexLogger plugin.

 

Getting Started

The NI License Manager (NILM) Third-Party SDK is available on ni.com or directly through VI Package Manager. Installing the NILM SDK allows plugin developers to get started experimenting with licensing integration – as the SDK includes an example license file.

 

FlexLogger Plugin Integration

The following steps describe the licensing approach taken in the attached “Licensing Example” plugin.  Given the state management described in the FlexLogger Plugin Development Kit manual, a plugin’s Initialize.vi provides a natural entry point for a plugin to prompt users for activation. In the example, an NILM session is opened and used to activate the plugin. The customer’s resulting action then drives the plugin’s behavior:Initialize-VI-1.PNG

 

 

Depending on the License status returned by Activate License.vi, the plugin performs two actions:

  • Sets the plugin’s licensed? boolean value (defined in Licensing Example.ctl).
  • Changes the plugin’s channel names to reflect the licensing status:
    • Errors with licensing shows License Error channels
    • Evaluation mode shows appends “(Evaluation)” to the plugin’s channel names.
    • Activated licenses shows the plugin’s typical/expected channel names.Initialize-VI-2.PNG

       

 

The plugin then checks the licensed? value to determine if it should execute any business logic. For example, the “Licensing Example” plugin skips all the execution logic in Configure Session.vi, Process.vi, and Cleanup Session.vi.Configure-Session-VI-1.PNG

 

 

Licensing files

The “Licensing Example” requires the developer manually or programmatically moves the *.lc file to ...ProgramData\National Instruments\License Manager\Licenses\ and moves the *.xml file to  ...ProgramData\National Instruments\License Manager\ProductInfo\ . Additionally, the plugin uses the example license that ships with the NILM SDK. For a FlexLogger plugin distributed via the NI Tools Network, the Licensing Third-Party Products with the NI License Manager API for LabVIEW describes the process to obtain a unique license file.

 

User Experience in FlexLogger

With the plugin and license files in the expected location (covered in detail in the Distributing FlexLogger Plugins section), users can seamlessly license plugins from within the FlexLogger application.

After adding the plugin in the Channel Specification, the NILM activation window launches and allows users to activate their plugin:Licensing-1.PNG

 

If the user cancels out of the licensing dialog, the “Licensing Example” plugin adds channels that notifies users they have a licensing problem:Licensing-2.PNG

 

If the plugin is activated, then the licensing dialog will stop appearing when users add an instance of the plugin and the plugin starts operating as expected:Licensing-3.PNG

 

 

Related links

FlexLogger Plugin Development Kit Manual

Creating Stand-Alone LabVIEW Applications Licensed by NILM

NI License Manager Third-party SDK

Licensing Third-Party Products with the NI License Manager API for LabVIEW

 

Distributing FlexLogger Plugins

 

LabVIEW 2019 added the ability to build packages compatible with NI Package Manager and SystemLink. With the 1.0 FlexLogger Plugin Development Kit only supporting LabVIEW 2019 64-bit, packages provide a distribution option that integrates well with the NI platform.

Building a Package

Build the Plugin’s Packed Library

When creating a new plugin, the FlexLogger plugin wizard scripts a packed library build specification (File>>Create Project….>> FlexLogger IO Plugin) that the FlexLogger application can consume.  Building the plugin’s packed library is a required step before a package containing that packed library can be built.

 

Create a Package Build Specification

Add a new Package build specification to the plugin’s LabVIEW project.Build-Spec-1.PNG

 

In the Destinations category, three different destinations are required:

  • Program Data\National Instruments\License Manager\Licenses
  • Program Data\ National Instruments\License Manager\ProductInfo
  • Public Documents\National Instruments\FlexLogger\Plugins\IOPlugins\<Plugin Name>\Build-Spec-2.PNG

In Source Files, move the license files to their corresponding directories and the packed library to the new IOPlugins directory.Build-Spec-3.PNG

 

In Package Attributes, specify the desired naming and contact information. Add the plugin's licensing information using a *.rtf file and the Include custom license agreement build option. Ensure Display in NI Package Manager when filtered by products is selected. 

package.PNG

In Dependencies, change the Filter options to All visible options and select FlexLogger. This option will prompt users to install FlexLogger if it is missing on their system. The FlexLogger application must be installed before it will appear in the Related packages list.
dependencies.PNG

 

 

Once any other change have been made to the build specification, the packages should be tested locally and on a separate FlexLogger test machine.

 

Installing the Package

The above configuration builds two separate NI Package files (*.nipkg) are built, one for the plugin and one for the custom license agreement. For local testing, the build specification's Add to feed option will build a feed you can use to install the plugin via NI Package Manager:
feed.PNG

To simulate testing on a customer machine, use NI Package Manager to create a feed from the command line. That feed can then be used to install the plugin. This approach mimics how the NI Tools Network distributes FlexLogger plugins via ni.com.

 

Once the package is installed, customers will be able to add the plugin to FlexLogger systems. Additionally, customers can upgrade and remove the plugin directly from NIPM.NIPM-3.PNG

 

 

Related Links

LabVIEW Help: Creating Packages for Distribution

NI Package Manager Help: Install Packages from a Feed

NI Package Manager Help: Creating a Feed

NI Tools Network Requirements for FlexLogger Plugins