How to Build DLL With Array Parameter and Used in LabVIEW

Updated Feb 25, 2026

Environment

Software

  • LabVIEW

This article will demonstrate how to use LabVIEW to build shared library (DLL) which contain array parameters for function and call the function in the library in VI via call function library node.

 

This demonstration will show how to create an addition function inside a shared library (DLL) and call that function from a LabVIEW VI using the generated DLL.

Building the DLL

  1. Start by creating a blank LabVIEW project.

  1. Add a new VI to the project. For each VI intended to be exported as a DLL function, ensure that all required inputs (controls) and outputs (indicators) are properly wired to the connector pane on the VI’s front panel.
    The example VI used here will be exported as a function named Add(X, Y) inside the DLL.

  1. In the Project Explorer, right-click Build Specifications and select New » Shared Library (DLL).

  1. In the Build Properties dialog, go to the Information section: 
    • Enter a name for the build
    • Specify the DLL file name
    • Choose the output directory for the DLL

  1. Next, navigate to the Source Files section and select the VIs that you want to export as functions in the DLL.

  1. In this example
    • Input X is scalar value
    • Input Y is an array
    • The function returns an array where each element is computed as X + Y[i]

The prototype definition refer below:

  1. After completing the configuration, click Build. The DLL will be generated in the location you specified in Step 4.

 

Call the DLL from a LabVIEW VI

  1. Create a new VI
  2. Place a Call Library Function Node on block diagram
  3. Double‑click the node and browse to the DLL file in Library name or path. Then select the function you want to call.

  1. In the Parameters tab, add and configure the parameters used by the selected function.
    For this example, the function includes:
    • 1 integer numeric input
    • 1 double numeric input
    • 2 double-precision arrays (input and output)

  1. Wire the Call Library Function Node as shown in the example. When you run the VI, the indicator arg3 should display the result of adding the scalar input arg1 to each element in array arg2.