Run VI Asynchronously Edit Tab

Insert a Run VI Asynchronously step and select Edit Run VI Asynchronously or Step Settings from the context menu to display the Run VI Asynchronously edit tab in the TestStand Sequence Editor .

Use the Run VI Asynchronously edit tab 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 edit tab 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.
  • Specified VI —The local path of the VI to run on the remote system. Click Specify VI to launch the Edit LabVIEW VI Call dialog box, in which you can specify the prototype and parameters of the VI. When you select multiple Run VI Asynchronously steps, TestStand dims the Specify VI button.
  • 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.
  • 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.

See Also

Calling VIs on Remote Computers

Edit LabVIEW VI Call dialog box

LabVIEW Utility Step Types

Thread

Wait Step