Plug-In Library

A plug-in library is an HTTP web API that contains services you use to take measurements. Plug-in libraries enable you to share and collaborate across teams.

Plug-In Library Installation

Windows Installation

The plug-in library is available as a stand-alone service, or as an optional package when installing InstrumentStudio using NI Package Manager.

To install the stand-alone service, search for Plug-In Library in NI Package Manager.
Note To install the optional command-line interface (CLI), search for Plug-In Library CLI in NI Package Manager.
To use a plug-in library with InstrumentStudio, select the optional Plug-In Library Service package when installing InstrumentStudio in NI Package Manager.
Note The plug-in library CLI installs by default with InstrumentStudio.

For more information on installing NI software, refer to the NI Package Manager user manual.

Linux Installation

NI Linux Device Drivers are required to use the plug-In library service and optional CLI on Linux. Refer to Installing NI Drivers and Software on Linux Desktop for more information on installing required drivers and feeds.

Use the following package names to install the plug-in library service and CLI:
  • ni-plugin-library-service-bin
  • ni-plugin-library-cli-bin

By default, the plug-in library service (nipluginlibrary.webapi) requires root access to run. If you do not want to run the service as root or via sudo, you can add a user to the nipluginlib group. This group owns files and folders accessed by the plug-in library service.

Starting a Plug-In Library

To start a plug-in library, run the nipluginlibrary.webapi binary. This file is located in the following paths:
  • Linux: Type (nipluginlibrary.webapi) and press Enter to locate the file.
  • Windows: <Program Files>\National Instruments\PluginLibrary
Once you have started the plug-in library, it will listen to requests from any source on port 43100 by default. These settings can be modified by following the instructions in Plug-In Library Settings.

Plug-In Library Settings

The following sections describes how to customize plug-in library behavior.

Changing Maximum Upload Size

To specify the allowed size of services being uploaded to a plug-in library, enter the following command:
nipluginlibrary.webapi.exe --PLUGINLIBRARY:MAX_UPLOAD_SIZE=<bytes>
  • To specify bytes, enter the number value, with no suffixes.
  • To specify megabytes, use either MB or mb as a suffix.
  • To specify gigabytes, use either GB or gb as a suffix.
Note To set this value using environment variables, create the following variable:
PLUGINLIBRARY__MAX_UPLOAD_SIZE=<bytes>

Changing the Default Host and Port

To change the plug-in library host and port address, enter the following command:
nipluginlibrary.webapi.exe --URLS=http://<host>:<port>
If you want to change the default port, enter the following command:
nipluginlibrary.webapi.exe --HTTP_PORTS=<port>
  • The <host> value specifies where web requests can come from. The default value for this parameter is *. This value allows requests to come from anywhere. To restrict requests to the local host, use localhost.
  • The <port> value specifies the port used. To assign ports dynamically, use 0.
    Note You cannot use localhost when specifying dynamic port binding. Instead, use either 127.0.0.1 or [::1] to specify dynamic port binding for locally restricted requests.

Assigning Port and Host Addresses via Environment Variables

Create the following environment variables to configure settings for your plug-in library:
  • To specify the host and port address, use URLS=http://<host>:<port>
  • To specify only the port address, use HTTP_PORTS=<port>

Dynamic port that accepts requests from anywhere

nipluginlibrary.webapi.exe --URLS=http://*:0

Single port that only accepts local requests, with a mamixum upload size of 300 MB

nipluginlibrary.webapi.exe --URLS=http://localhost:43102
         --PLUGINLIBRARY:MAX_UPLOAD_SIZE=300mb

Plug-In Library Configuration Files

Plug-in library settings can be configured using configuration files. Refer to the following sections for information on how to create and use configuration files to manage plug-in library settings.

Configuration File Format

The following code snippet shows the typical contents of a .JSON configuration file.

{
  "URLS": "https://localhost:43207",
  "PLUGINLIBRARY":{
    "MAX_UPLOAD_SIZE": "300mb"
  }
}

Configuration File Name and Location

You must name your configuration file pluginlibrary.json.

Configuration files must be saved at the following paths, depending on your OS:
  • Windows: %localappdata%\National Instruments\PluginLibrary\pluginlibrary.json
  • Linux: $HOME\.config\ni\pluginlibrary.json