Although you can use either the Call Library Function Node or the Import Shared Library wizard to call shared library functions, the Import Shared Library wizard can accelerate the process of integrating the shared library functions and reduce the potential for errors when calling these libraries.

If you provide the name of a shared library file and a header .h file, the wizard parses the header file and generates a wrapper VI for each function in the shared library, which the wizard saves in a LabVIEW project library .lvlib. The VIs that the wizard generates each contain a Call Library Function Node that accesses the selected function from the shared library.

The Import Shared Library wizard has the following advantages compared to using the Call Library Function Node directly:

  • The wizard automatically configures the Call Library Function Nodes generated in the wrapper VIs by the wizard. Optionally, you also can customize the configuration for this Call Library Function Node.
  • You can use the wizard to configure calls to multiple functions or entire libraries at once. With the Call Library Function Node, you must configure each node to call a function in a shared library individually.
  • Because the wizard generates the wrapper VIs in the shared library you specify, you can easily locate and update those VIs. For example, if you want to add or remove some of the functions you already imported from the shared library, you can run the Import Shared Library wizard again to update the previously generated wrapper VIs. You can run the wizard multiple times on the same shared library file.
  • The wizard converts the data types in the shared library to LabVIEW data types. For example, the wizard automatically generates cluster data types for any structure data types in the shared library functions. With the Call Library Function Node, you must manually convert the structure data type.

If you want to individually configure each call to a shared library or if you want to customize configurations for calling shared libraries, use the Call Library Function Node to call libraries directly. Otherwise, use the Import Shared Library wizard to automate this process.

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.

Related Information

Using the Import Shared Library Wizard

Importing Functions from a Shared Library File

Example: Importing Functions from a Shared Library File (Windows)

Troubleshooting the Import Shared Library Wizard

Call Library Function Node