|LabVIEW 2016 Help|
|LabVIEW 2017 Help|
|LabVIEW 2018 Help|
|LabVIEW 2019 Help|
|LabVIEW 2020 Help|
When you open a reference for a VI that you want to call asynchronously, you must decide whether you want to collect the results of the VI later. This topic describes how to start an asynchronous call-and-forget VI call without tracking when or what values the VI returns. Other programming languages describe this usage model as fork-and-forget. Alternatively, you can call a VI and collect its results later.
Use the following block diagram objects to asynchronously call a VI without collecting its results:
Create the following block diagram to dynamically start an asynchronous call to a VI without collecting the results.
The following list describes important details about the previous diagram.
|Include the 0x80 flag as part of the options input to the Open VI Reference function. This option flag causes LabVIEW to create a call-and-forget VI reference to be called asynchronously without returning its results.
|The Start Asynchronous Call node does not allow you to collect outputs immediately. If you want to access the outputs of a VI you called asynchronously, you must explicitly prepare the VI reference to return its outputs.|
|After the Start Asynchronous Call node calls the referenced VI, the rest of the calling block diagram continues executing without waiting for the referenced VI to complete.|
|You can close the VI reference with the Close Reference function as soon as you are finished using it to start asynchronous calls to the referenced VI. When you close a call-and-forget VI reference, LabVIEW does not abort instances of the VI that are already running. However, once you close the reference, it becomes invalid so that you can no longer use VI Server properties and methods on the reference. This behavior differs from closing call-and-collect VI references.|
Refer to the Asynchronous Call and Forget VI in the labview\examples\Application Control\VI Server\Asynchronous Call By Reference directory for an example of asynchronously calling a VI without collecting its results.