Calling a Shared Library in a NI Linux Real-Time Target and LabVIEW Real-Time Module

Updated Mar 18, 2026

Environment

Software

  • LabVIEW

Operating System

  • LabVIEW Real-Time (NI Linux Real-Time)
  • Linux

This article explains how to use the Import Shared Library Wizard to build a VI wrapper for calling a shared library (*.so) file in a NI Linux Real-Time (RT) Target.

  1. In your host PC, launch LabVIEW.
  2. Open the Import Shared Library Wizard
    1. Tools» Import » Shared Library (.dll)…
  3. Select Create VIs for a shared library option.
  4. Search for your shared library .so and its header *.h files to import.
    1. By default, the wizard search for *.dll files, so change the windows file explored to search All Files (*.*)
    2. Check Shared library file is not on the local machine to force the wizard to accept *.so file

  1. Skip the Configure Include Paths and Preprocessor Definition section. 
  2. Select the functions you want to import to LabVIEW.
    1. If your shared library includes a function that uses complex data types like classes or structs, these functions will not be listed in the wizard. So, you have to create a manually a VI to call those functions by using the Call Library Function Node.

  1. In the Configure Project Library Settings section you will be requested to set a name and path for a LabVIEW library that will include your wrapper VIs.

  1. Select your Error Handling Mode
  2. Configure the controls and indicators of the VIs that call the shared library functions

 

Now you have a LabVIEW VI wrapper that call the functions of your shared library file. Now, follow the steps below to load the shared library and configure the correct path of your NI Linux RT target.

 

  1. Load your shared library file into your RT target to the directory /home/lvuser/natinst/bin/
    1. Refer to Using WebDAV to Transfer Files to Real-Time Target
  2. Once the LabVIEW library was created, add it to your LabVIEW project under your NI Linux RT target.
  3. Open any wrapper VI, double-click the Call Library Function Node and change the library name or path option to /home/lvuser/natinst/bin/<yourSOfilename>.so this will make the VI to search in the same location the shared library was stored in the RT target.