VI Server

From LabVIEW Wiki
Jump to: navigation, search
VI Server - Open Reference, Property Node, Close Reference

VI Server, introduced in LabVIEW 5.0, is a set of functions that allows you to dynamically control front panel objects, VIs, and the LabVIEW environment. With VI Server, you can also programmatically load and run VIs and LabVIEW either on the same machine or across a network. The VI Server functions are located in the Functions » Application Control sub-palette. All VIs have properties that can be read or set and methods that can be invoked using these VI Server functions. VI Server replaces the VI Control VIs of LabVIEW 4.x.

VI Server has an object-oriented architecture that is platform-independent, (see VI Server Class Hierarchy).  Each object that is a part of VI Server is a part of a class. The class that the object is a part of determines what properties and methods are available. Many of these classes have sub-classes. For instance, any boolean control is a member of the Boolean class, which is a member of the Control class. The Control class is a member of the GObject class, which is a member of the Generic class. Lower level classes, such as the Boolean class, have their own properties and methods, and inherit properties and methods from higher level classes, such as the Generic class.

In order to create a VI Server session, one has to open an Application Reference to remote computers and a VI Reference [VI-Ref] on the desired computer. With that VI-Ref one can perform actions with the VI like setting or retrieving control values, running it or setting and retrieving the VIs properties.

VI Server Levels

Basic Development Environment

Basic VI Server Calls

The Basic Development Environment holds all of the basic functions to modify properties and methods for:

  • Controls and Indicators
  • Panes and Panels
  • VIs
  • ProjectItem (Projects, Libraries, and Classes)
  • Application

The standard color of Class Specifier Constant, Property Nodes, and Invoke Nodes is yellow when they do not contain any scripting, private, or deprecated Classes, Properties or Methods, respectively. As soon as one of the others appear in the Property Node or Invoke Node the color will change according to the following order of importance:

  • Deprecated
  • Private
  • Scripting
  • Basic

Meaning if one property in a Property Node is Deprecated and all others are one of the other types, the property will appear red for the deprecated property.

VI Scripting

Scripting VI Server Calls

VI Scripting adds functionality to modify properties and methods for:

  • Block Diagram
    • Primitives
    • Structures
    • Terminals
  • Connector Pane

When scripting is enabled the Class Specifier Constant, Property Nodes, and Invoke Nodes turn light cyan when containing scripting Classes, Properties and Methods, respectively. If scripting functions are being used but scripting is then disabled, they will continue to work but will appear the standard yellow and will no longer be discoverable.

Private

Private VI Server Calls

This adds more, lower level control and functionality. There is a reason they are private. They are not always fully vetted or documented. They also could change from one version of LabVIEW to the next and they might not be in the LabVIEW Run-Time Engine, (meaning they cannot be used in built executable). Use at your own risk.

When the private functions are enabled the Class Specifier Constant, Property Nodes, and Invoke Nodes turn brown when containing private Classes, Properties and Methods, respectively. If private functions are being used but then the functionality is disabled, they will continue to work but they will appear either the standard yellow, or if scripting is turned on they might appear light cyan, and they will no longer be discoverable.

To expose the Private classes, methods, properties, and events edit your LabVIEW configuration file to include the SuperSecretPrivateSpecialStuff=True setting. You can search the LAVA forums for the tag Private method for additional events and use cases.

Deprecated

Deprecated VI Server Call and Its Replacement

From time-to-time, G is modified to give more features or to regroup functionality. In these cases the old version of properties and methods could be taken out of use, or deprecated. These features are never fully removed, to keep from breaking older programs, but they are no longer discoverable in Property Nodes or Invoke Nodes. This can be overridden by turning on "ObjectManager.ShowDeprecated" in the Ned options, allowing deprecated properties and methods to be selected from the menu, but there is little to no reason to do so.

Articles

Exploring the Depths of the VI Server - by Quentin Alldredge, Q Software Innovations

This presentation goes into the depths of the VI Server including Basic LabVIEW, VI Scripting, and even the Private stuff, showing many of the Properties, Methods, and Events I have found useful in the creation of LabVIEW IDE add-ons.

Tools

VI Server Toolkit - shared code library for discovering the Classes, Properties, Methods, and Events in the VI Server.