Adds a new VI object to the front panel or block diagram of the VI specified by owner refnum and returns a reference to the new object. VI objects include any controls, nodes, calls to subVIs, and user-defined controls that you can create in the LabVIEW editing environment.


icon

Inputs/Outputs

  • cbool.png auto wire? (F)

    auto wire? specifies whether LabVIEW attempts to automatically wire the terminals of the new object with compatible terminals of the source object wired to location. National Instruments recommends that you do not use this input. Instead, use VI Scripting to wire the new object to other objects precisely.

  • cgnrn.png vi object class

    vi object class indicates the class of the object you want to create. To specify a class, wire a class specifier constant to this input. A class specifier constant displays a hierarchical menu that contains the classes of all of the objects in LabVIEW. To identify which class to use for a specific object, explore the anatomy of common VI objects.

  • cgnrn.png owner refnum

    owner refnum is a reference to the container into which you want to place the new object. The most common containers are VIs, clusters, and the diagrams of loops and other structures. For example, to add a new control to the front panel of a VI, wire a reference to either the relevant VI or the front panel of the relevant VI to owner refnum. To place a new object inside of a For Loop, wire a reference to the diagram of the relevant For Loop to owner refnum.

  • cu32.png style

    style indicates the exact kind of object to create. When you create a constant from the style terminal, you obtain a list of all the objects that are native to LabVIEW. Select a value for style that is compatible with the class specified by vi object class. For example, you can select the Round Push Button style if viobject class is Boolean, and you can select the Add style if viobject class is Function. However, LabVIEW returns a run time error if you select the Add style when viobject class is Boolean because this pairing is not compatible.

  • cnclst.png location

    location specifies where the function places the new object within the container referenced by owner refnum. The location terminal accepts the following three kinds of arguments:

    • Pair of x, y coordinates—LabVIEW places the new object at the given coordinates in relation to the origin of the owner. To quickly create this type of cluster, create a constant from the location terminal.
    • Reference to a pre-existing object—LabVIEW places the new object next to the referenced object.
    • New VI Object Offset From Referenced Object cluster—LabVIEW places the new object a specified distance from the object referenced by this cluster.

    Refer to the New VI Object Location Argument VI in the Examples section of this topic for a visual comparison of these argument types.

  • ci16.png Horizontal

    Horizontal is the horizontal position.

  • ci16.png Vertical

    Vertical is the vertical position.

  • cerrcodeclst.png error in (no error)

    error in describes error conditions that occur before this node runs. This input provides standard error in functionality.

  • cpath.png path

    path is a path to a subVI or pre-existing custom control. Wire data to path only when you want to add one of these objects to the owner.

  • cnclst.png bounds

    bounds specifies the width and height of the new object if the new object is resizable. LabVIEW ignores bounds for fixed-sized objects.

  • cu32.png Width

    Width specifies the width of the object.

  • cu32.png Height

    Height specifies the height of the object.

  • ignrn.png object refnum

    object refnum returns a reference to the new object created by this function. The reference is of the class specified by vi object class.

  • ierrcodeclst.png error out

    error out contains error information. This output provides standard error out functionality.