Building VI Server Applications

LabVIEW 2018 Help

Edition Date: March 2018
Part Number: 371361R-01
View Product Info

DOWNLOAD (Windows Only)

LabVIEW 2016 Help
LabVIEW 2017 Help
LabVIEW 2018 Help
LabVIEW 2019 Help
LabVIEW 2020 Help

The programming model for VI Server applications is based on refnums. Refnums also are used in file I/O, network connections, and other objects in LabVIEW.

Typically, you open a refnum to an application instance or to a VI. You then use the refnum as a parameter to other VIs. The VIs get (read) or set (write) properties, execute methods, or dynamically load and call a referenced VI. Finally, you close the refnum, which releases the referenced VI from memory.

Use the following Application Control functions and nodes to build VI Server applications:

  • Open Application Reference—Opens a reference to a local or remote application instance.
  • Open VI Reference—Opens a reference to a VI on the local or remote computer or dynamically loads a VI from disk.
  • Property Node—Gets and sets VI, object, or application properties.
  • Invoke Node—Invokes methods on a VI, object, or application.
  • Call By Reference Node—Calls a dynamically loaded VI.
  • Start Asynchronous Call Node—Starts an asynchronous call to a dynamically loaded VI.
  • Wait On Asynchronous Call Node—Collects the results of an asynchronously called VI.
  • Close Reference—Closes open references to the VI, object, or application you accessed using the VI Server.

Application and VI References

You access VI Server functionality through references to two main classes of objects—the Application object and the VI object. After you create a reference to one of these objects, you can pass the reference to a VI or function that performs an operation on the object.

An Application reference refers to a local or remote application instance. You can use Application properties and methods to change LabVIEW preferences and return system information. A VI refnum refers to a VI in an application instance.

With a reference to an application instance, you can retrieve information about the LabVIEW environment, such as the platform on which LabVIEW is running, the version number, or a list of all VIs currently in memory. You also can set information, such as the list of VIs exported to other application instances. Because you can open multiple application instances at once, you must use an application reference when you are using VI server properties and methods in one application instance, and you want to interact with a different application instance. For example, LabVIEW opens a new application instance when you create a LabVIEW project or a target for a LabVIEW project.

When you create a refnum to a VI, LabVIEW loads the VI into memory. The VI stays in memory until you close the reference and until the VI meets the following conditions:

  • There are no other open references to the referenced VI.
  • The front panel of the VI is not open.
  • The VI is not a subVI of another VI in memory.
  • The VI is not a member of an open project library.

With a refnum to a VI, you can update all the properties of the VI available in the VI Properties dialog box as well as dynamic properties, such as the position of the owning pane. You also can programmatically print the VI documentation, save the VI to another location, and export and import its strings to translate into another language.


Not Helpful