Table Of Contents

Calling Shared Libraries

Last Modified: November 20, 2020

Define calls to a shared library to integrate external code into your application.

A shared library is a file containing executable program modules that different programs can use. To call these shared library functions in your application, use a Shared Library Interface (SLI) document. Use one SLI per shared library. To call functions from another shared library, create a new SLI to access those functions.

Create an SLI.

  1. On the Project Files tab, add an SLI to your project. An SLI document appears in your project.
  2. In the SLI, click the ... button and select the shared library on disk.
  3. Define the prototype for a function you want to call from the shared library. A defined call to a function in an SLI is called an entry point.
    1. Click Add function.
    2. On the Item tab, select the function prototype symbol. The entry point's name reflects the symbol you select.
    3. Click Add parameter.
    4. On the Item tab, specify the parameter name, data type, and behavior.
  4. Repeat step 3 to create as many entry points as you need for your project.
  5. Save the SLI.

Use the entry points in any application in your project.

  1. Open the VI in which you want to call the shared library.
  2. On the diagram palette, click Project Items >> Software. Click the SLI folder to show every entry point you defined in that SLI.
  3. Drop the entry points you want to use on the diagram.
  4. Wire the entry points and complete the diagram.
  5. Run the VI. Input data passes from the diagram to the external code, and data returns from the external code to the diagram.

Recently Viewed Topics