Calling Shared Libraries

Call Library Function Node

Calling Shared Libraries

You can call shared libraries from LabVIEW. If you have existing applications written in other languages, such as C, Visual Basic, and Visual C++, you can use the Call Library Function Node for incorporating code directly into a LabVIEW block diagram. The Call Library Function Node is also useful for applications that use mathematical analysis routines or custom-designed data acquisition hardware.

(Windows) A shared library is called a DLL.

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

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

You can use any language to write shared libraries as long as the shared libraries can be called using one of the calling conventions LabVIEW supports, either stdcall or C. 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.

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.

Refer to the labview\examples\dll directory for examples of using shared libraries.

(Windows) You also can use functions that belong to the MathScript 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 MathScript.

Browse related examples

(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.