Sending Multiple HTTP Requests to the Same LabVIEW Web VI and Processing Them in Parallel

Updated Apr 17, 2024

Environment

Software

  • LabVIEW

I want to send multiple HTTP request to the same  LabVIEW web service and have them processed in parallel. What settings should I do to achieve parallel processing of multiple HTTP requests on the same web service?


You can learn the basics of creating and publishing a LabVIEW web service in this document .

To send multiple HTTP(POST) requests to a web VI simultaneously and, have them processed in parallel, the VI's reentrancy property should allow simultaneous calls (by default, LabVIEW configures VIs for non-reentrant execution).
  1. Open the web VI you want to send multiple HTTP requests to, and select File>> VI property.
  2. Go to the Execution category and select Shared clone reentrant execution or Preallocated clone reentrant execution.
  3. Click OK and save the VI.

キャプチャ.PNG

This document explains more about VI reentrancy and how to choose which type of reentrant execution to use.

In the below example, multiple HTTP POST requests are send to the same web VI (Parallel.vi , with Shared clone reentrant execution). This Web VI then calls a subVI (AnalysisWait.vi) to perform simple array processing, and output the start and end times of the VI's execution.
(Sample program can be downloaded from the attachments files at the bottom of this document)

キャプチャ2.PNG

postHTTPs.PNG


 

As in the below pictures, we can see that all 3 HTTP requests simultaneously send to the same web VI(Parallel.vi) are processed at almost the same time(StartTime) when the VI reentancy is set to Shared clone reentrant execution. Each execution StopTime is set by the specified WaitTimeMs

reentrancyresults.PNG