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.
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.
The DLL sets the following input values.
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.
The DLL path and input values are set manuallyThe results output after sequence execution can be configured in Properties → Additional Results