A VirtualInstrument object exports methods that affect a given VI. A VirtualInstrument object is instantiated by invoking the GetVIReference method on the Application object.

Note Methods parameters denoted by [] are optional for that method.

Refer to the ActiveX Enumerations for more information about enumerations used in various properties.

Methods

MethodDescription
Abort

Aborts the VI execution.

Call

Calls the VI as a subVI.

Call2

Calls the VI as a subVI. Optionally, you can open the front panel of the VI and close it after the call is over. You also can suspend the VI when called.

CenterFrontPanel

Specifies whether to automatically center the LabVIEW front panel window on the computer screen.

CloseFrontPanel

Closes the LabVIEW front panel window.

DisconnectFromLibrary

Disconnects the VI from the owning LabVIEW project library.

ExportVIStrings

Exports the following strings about VI and LabVIEW front panel objects to a tagged text file: VI name and description, object caption labels, object free labels, default data (string, table, path, and array default data), private data (listbox item names, table row and column headers, graph plot names, graph cursor names, graph annotation names, and tab control page captions), and polymorphic VI data (instance names in the polymorphic VI and selector shortcut menus).

FPGetRuntimePos

Returns the position of the LabVIEW window at run time.

FPRunTimePosRunCentered

Sets a VI to center its front panel every time the VI runs.

FPRunTimePosRunCustom

Sets a custom position for the VI to move its front panel to every time the VI runs.

FPRunTimePosRunMax

Sets a VI to maximize its front panel every time the VI runs.

FPRunTimePosRunMin

Sets a VI to minimize its front panel every time the VI runs.

FPRunTimePosRunUnchanged

Sets the VI to not move its front panel when the VI runs.

GetControlValue

Gets the value of the named LabVIEW control or indicator as variant data. Use the LabVIEW Variant to Data function to convert the data to another LabVIEW data type.

GetLockState

Returns the lock state of the VI and indicates whether the password for the VI is in the password cache.

GetVIDependencies

This method returns the names and paths of the VI dependencies of a VI. You can use this method to return a specific subset of the total set of VI dependencies of a VI. This method does not return non-VI dependencies, such as project libraries, XControls, classes, and statecharts.

ImportVIStrings

Imports the following strings about VI and LabVIEW front panel objects from a tagged text file: VI name and description, object caption labels, object free labels, default data (string, table, path, and array default data), private data (listbox item names, table row and column headers, graph plot names, graph cursor names, graph annotation names, and tab control page captions), and polymorphic VI data (instance names in the polymorphic VI and selector shortcut menus).

MakeCurValueDefault

Changes the defaults of all controls on the LabVIEW front panel to be the current values. This method is available only in edit mode.

OpenFrontPanel

Opens the LabVIEW front panel window. If the front panel is already open, this method changes the state of the front panel window to the state you wire to this method. Use the CloseFrontPanel method to close the front panel window.

You also can use the FPState property to set the state of a front panel window that is already open.

PrintPanel

Prints just the LabVIEW front panel to the current printer. You cannot use this method to print a block diagram, list of controls, or polymorphic VI front panel.

PrintVIToHTML

Saves the VI information to an HTML file and saves the graphics in external files.

PrintVIToPrinter

Prints the VI information to a printer. If you use this method in a stand-alone application or DLL, LabVIEW prints only the front panel.

PrintVIToRTF

Saves the VI information to an RTF file.

PrintVIToText

Saves the VI information to a text file. You cannot save the icon, connector pane, front panel, block diagram, subVI icons, and VI hierarchy to text.

ReinitializeAllToDefault

Changes the current values of all controls on the LabVIEW front panel to their defaults.

Revert

Discards changes and reloads a VI from disk.

Run

Starts the VI execution, similar to the Run button in LabVIEW. This method is different than calling a VI because it uses the current values of all front panel controls for execution rather than using data passed in through parameters. This method also ignores the

property of a VI and the property. You cannot use this method to run a VI that is already reserved for execution by another VI.

SaveForPrevious

Saves a copy of the VI that is readable by LabVIEW 8.0 and later.

SaveInstrument

Saves a VI and synchronizes the VI with the edited version in other application instances before saving.

SaveRunTimeMenu

Saves the LabVIEW run-time menu to a file specified by filePath. This method works only when the VI is running. It saves only menu items with valid tags.

SetControlValue

Sets the value of a named LabVIEW control or indicator.

SetLockState

Sets the lock state of a VI. If Interactive is FALSE (default), you can use Password to unlock a password-protected VI or set the password of an unprotected VI. If Interactive is TRUE, LabVIEW ignores Password and displays a dialog box that prompts you to change the lock state.

SetVIIcon

Sets the image of a VI icon from a file.