Common VI Scripting Tasks

When you use VI Scripting to inspect, edit, or create a target VI, you often combine multiple small VI Scripting tasks to accomplish a larger scripting goal. This topic lists some of the most common VI Scripting tasks and links to information and examples about the functions, properties, and methods that you can use to complete those tasks. Some of the more complex tasks link to separate topics.

Obtaining References to VIs and VI Objects

Creating VIs and VI Objects

Inspecting and Editing VIs and VI Objects

Miscellaneous

Navigating between the Front Panel and the Block Diagram of a VI

Use the following properties to navigate between the front panel and the block diagram of a VI programmatically:

Creating a New Blank VI

Use the New VI function to create a new blank VI programmatically.

Refer to the VI Scripting tutorial for detailed instructions about creating and opening a new blank VI programmatically.

Creating a Constant, Control, or Indicator from a Terminal

Use the following methods to create a constant, control, or indicator from a terminal programmatically:

Adding, Duplicating, and Removing Frames of a Structure with Multiple Diagrams

Use the following methods to interact with the frames of a structure with multiple diagrams programmatically:

Wiring Objects to Other Objects

Use the following methods to wire objects to other objects programmatically:

Refer to the Creating New VI From Scratch VI in the labview\examples\Application Control\VI Scripting\Creating VIs directory for an example of using the Terminal:Connect Wire method to wire two objects together.

 Open example  Find related examples

Refer to the VI Scripting tutorial for an example of using the Node:Connect Wires method to wire two objects together.

Moving or Copying an Object

Use the GObject:Move method to move an object programmatically:

Replacing an Object

Use one of the following methods to replace an object programmatically:

Refer to the Creating New VI From Template VI in the labview\examples\Application Control\VI Scripting\Creating VIs directory for an example of using the Replace method to replace an object.

 Open examples  Find related examples

Deleting an Object

Use the Generic:Delete method to delete an object programmatically.

Refer to the Closing References VI in the labview\examples\Application Control\VI Scripting\Managing References directory for an example of using the Delete method to delete a wire.

 Open example  Find related examples

Selecting Objects to Cut, Copy, and Paste

Use the following properties to access selected objects programmatically:

Use the following methods to edit selections programmatically:

Interacting with the Label of a Node

Use the Node:Label property to interact with the label of a node programmatically.

Undoing Actions

Use the following methods to undo VI Scripting actions programmatically:

Refer to the Supporting Undo VI in the labview\examples\Application Control\VI Scripting\Supporting Undo directory for an example of using the Transaction methods to undo actions programmatically.

 Open example  Find related examples

Block Diagram Cleanup

Use the VI:Block Diagram:Clean Up method to clean up the block diagram of a target VI:

Using Object Tags

Use the following methods to get and set object tags programmatically:

Refer to the Tagging VI in the labview\examples\Application Control\VI Scripting\Finding and Modifying Objects directory for an example of using the Tag methods to add tags to objects and find the tagged objects.

 Open example  Find related examples

Showing the Front Panel or Block Diagram of a VI

Use the following properties and methods to show or position the front panel or block diagram of a target VI programmatically:

Refer to the Creating New VI From Scratch VI in the labview\examples\Application Control\VI Scripting\Creating VIs directory for an example of opening and positioning the front panel and block diagram of a newly created VI.

 Open example  Find related examples