Run VI Asynchronously Step Configuration Dialog Box
- Updated2025-07-21
- 3 minute(s) read
Run VI Asynchronously Step Configuration Dialog Box
Select Configure Run VI Asynchronously in the context menu for the step to launch the Run VI Asynchronously Step Configuration dialog box from a TestStand User Interface . You can also click Configure Run VI Asynchronously on the General tab of the Step Properties dialog box.
Use the Run VI Asynchronously Step Configuration dialog box to specify the remote system, port number, and VI to run. When TestStand executes the Run VI Asynchronously step, TestStand launches a dynamically-generated sequence in a new thread which executes the VI on a remote system.
The Run VI Asynchronously Step Configuration dialog box contains the following options:
-
Hostname
—The remote system. Leave this option empty to use the local computer.
Note The Run VI Asynchronously step does not support running a VI on a remote Microsoft Windows computer.
- Specify Remote Host by Expression —Enable this option to specify that the Hostname control contains an expression the step evaluates at run time to determine the name of the remote host.
- Port Number —The TCP/IP port number to use to connect to the remote system.
- Timeout (ms) —The time, in milliseconds, to wait for a connection before timing out. A value of –1 indicates to wait indefinitely.
- Store an Object Reference to the New Thread in (optional) —The location to store the reference to the new Thread object the step creates. You can use this reference in subsequent calls to the TestStand API. You can also use this reference in a Wait step to wait for the thread to complete.
- Automatically Wait for the Thread to Complete at the End of the Current Sequence —Specifies whether the calling sequence does not complete execution until the thread this step launches completes execution.
- Specified VI —The local path of the VI to run on the remote system. Click the LabVIEW icon to launch the Edit LabVIEW VI Call dialog box, in which you can specify the prototype and parameters of the VI.
-
Context to Pass as ThisContext for VI Arguments
—The context the step uses when you pass
ThisContext
as a parameter. Select from the following options:
-
Use Context of Calling Thread (Accessing the context of the calling thread requires additional synchronization for thread safety.)
—When you specify
ThisContext
as an argument for a parameter of a VI, TestStand uses the context of the calling thread. If you enable this option, also enable the
Automatically Wait for the Thread to Complete at the End of the Current Sequence
option to ensure that TestStand does not clean up the context of the calling thread before the asynchronous VI completes.
Notice Using the context of the calling thread in the newly created thread can lead to race conditions and crashes because the calling thread continues to execute in parallel, and TestStand might create or remove variables in the context of the calling thread while the sequence is running or when the sequence completes. TestStand does not automatically ensure thread safety for structural changes to variables, such as adding or removing subproperties.
- Use Context of New Thread (National Instruments recommends using this option if you do not need direct access to data from the calling sequence.) —When you specify ThisContext as an argument for a parameter of a VI, TestStand uses the context of the new thread. If you need to access variables from the context of the calling thread, pass the variables as parameters to the VI instead.
-
Use Context of Calling Thread (Accessing the context of the calling thread requires additional synchronization for thread safety.)
—When you specify
ThisContext
as an argument for a parameter of a VI, TestStand uses the context of the calling thread. If you enable this option, also enable the
Automatically Wait for the Thread to Complete at the End of the Current Sequence
option to ensure that TestStand does not clean up the context of the calling thread before the asynchronous VI completes.
See Also
Calling VIs on Remote Computers