Use the Import Shared Library wizard to create or update a LabVIEW project library of wrapper VIs for functions in a Windows .dll file, an OS X .framework file, or a Linux .so file.

Note The Import Shared Library wizard provides the file option for only the platform on which it is running.

The Import Shared Library wizard supports most C and C++ header files. The wrapper VIs the that wizard creates use the Call Library Function node. The Call Library Function node does not support the C++ this pointer or calling methods in C++ classes.

Note If you want to import a shared library file for an instrument driver, you can download the LabVIEW Instrument Driver Import Wizard from ni.com.

The Import Shared Library wizard does the following:

  1. Parses the header file
  2. Lists the functions in the shared library
  3. Converts data types in the shared library to LabVIEW data types
  4. Generates a wrapper VI for each function
  5. Saves the VIs in a LabVIEW project library that you can edit
  6. Creates an HTML report about the generated library that you can launch when you complete the wizard

In the wizard, you can:

  • Specify include paths and preprocessor definitions
  • Configure the individual VIs that wrap each function
  • Configure memory allocation and error handling

The wizard also creates custom controls for structure elements in the original functions. The wizard then adds the controls to the project library. You can use the custom controls to modify all the VIs in the library that contain the corresponding data type.

You can run the wizard multiple times on the same shared library file. If you select Update VIs for a shared library on the Specify Create or Update Mode page, the wizard overwrites the previous version of the project library file and the existing VIs within that file. If you choose not to re-import generated VIs within the project library file, the VIs remain unchanged in the directory.

The wizard retains the most recent settings for each individual function in a particular shared library. For example, if you have a shared library that contains three functions, you might update only the second function. In this case, the wizard retains the original settings for functions one and three and the new settings for function two.

To launch the Import Shared Library wizard, select Tools » Import » Shared Library. To create wrapper VIs for shared library files with the wizard, follow the prompts. You must provide the following:

  • The name of a shared library file
  • A header .h file for the wizard to parse

Refer to the Importing Functions from a Shared Library File topic for step-by-step instructions for importing a shared library and creating wrapper VIs.