Calling Shared Libraries

A shared library is a file containing executable program modules that any number of different programs can use to perform some function. You can call these program modules, or shared library functions, from LabVIEW by using the Call Library Function Node. Call a shared library function when you want to accomplish any of the following tasks:

Shared Libraries on Different Platforms

(Windows) A shared library is called a DLL.

(OS X) A shared library is called a Framework.

(Linux) A shared library is called a Shared Library function.

General Approach to Calling Shared Libraries

Calling a shared library function in LabVIEW includes the following actions:

  1. You obtain or create a shared library.
  2. You configure a Call Library Function Node to call a function within the shared library.
  3. LabVIEW calls the function when the Call Library Function Node executes.
  4. LabVIEW passes input data from the block diagram to the executable code.
  5. LabVIEW returns data from the executable code to the block diagram.


After you configure a Call Library Function Node to call a shared library function, you can change the shared library without changing the calling VI or the Call Library Function Node, provided you do not modify the function prototypes.

LabVIEW loads shared libraries in a unique application instance. Opening a shared library in a unique application instance prevents naming conflicts with VIs in the shared library, and VIs outside of the shared library.

Limitations on Calling Shared Libraries in LabVIEW

Examples and troubleshooting information help you build and use shared libraries and successfully configure the Call Library Function Node in LabVIEW. The general methods described here for DLLs also apply to other types of shared libraries. Refer to the labview\examples\dll directory for examples of using shared libraries.

Find related examples

Note�� (MathScript RT Module) You also can use functions that belong to the MathScript RT Module libraries class to call shared libraries from the LabVIEW MathScript Window or the MathScript Node. Refer to the MathScript Shared Libraries.lvproj in the labview\examples\MathScript\MathScript Shared Libraries directory for examples of calling shared libraries from the MathScript RT Module.

(Windows) To view related topics, click the Locate button, shown at left, in the toolbar at the top of this window. The LabVIEW Helphighlights this topic in the Contents tab so you can navigate the related topics.