How to Execute DLLs Built in LabVIEW in Parallel Using TestStand

Updated Jul 6, 2026

Environment

Software

  • LabVIEW
  • TestStand

This article explains how to create a C/C++ DLL from a LabVIEW program and execute it in parallel. DLL execution is performed using TestStand. The following software is required to validate this procedure:

  • LabVIEW Professional Edition 2019 or later
  • TestStand (64-bit) 2019 or later

To execute a DLL in parallel, the following two conditions must be met:
1) The DLL must be created to support parallel execution.
2) Each DLLs is executed in its own thread.

 

Create a Parallel-Executable DLL in LabVIEW 

The following program can be obtained from the Attachments of this article.

This program is intended to verify that data storage areas such as queues, tunnels, shift registers, and local variables maintain independent values in each thread when executed in parallel.

This program performs the following behavior:

  • Acquires a timestamp every second

  • Passes data using queues and local variables

  • Stores data in a shift register or tunnel in another loop

  • After completing four timestamp checks, outputs the data stored in the shift register as a string

By configuring reentrant execution in the Execution settings of the VI Properties of this program, the program can be made capable of parallel execution when converted into a DLL.

 

01main.png


The DLL sets the following input values.

2dll.png

 

Execute the DLL in Parallel in TestStand

When executing a process in parallel across multiple threads in TestStand, it is necessary to call a subsequence from the main sequence file.

Here, in the MainSequence, the Sequence Call step is used to call the sequence four times in parallel and execute it.

In the settings of the Sequence Call, set Execution Options to Use New Thread.

By using this setting, you can confirm that the Settings section of each Sequence Call in the Main Sequence is set to New Thread.

 
03main.png

The DLL path and input values are set manuallyThe results output after sequence execution can be configured in Properties → Additional Results

 

04actionseq.png

When executing the TestStand sequence file with the above settings, the four Sequence Calls start at the same time as shown below.

After that, when the processing inside the DLL is completed, the completion of each Sequence Call can be confirmed in the Wait step.

5exe.png

 

After executing the above sequence, when confirming the results, as shown below:

  • The DLL is executed in each of the four Sequence Calls

  • Timestamp confirmation, data storage, and data output for approximately four seconds are performed independently at nearly the same timing

6results.png

 

The red box indicates the DLL execution start time, and the blue box indicates the stop time.

You can confirm that:

  • The DLL starts and stops almost simultaneously for each Sequence Call

  • Timestamp confirmation and data transfer are performed independently