Common VI Scripting Tasks
- Updated2025-04-01
- 4 minute(s) read
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
- Obtaining a reference to a target VI
- Obtaining references to objects in an unknown target VI
- Obtaining references to objects in a known VI
- Navigating from a node to a wire
- Navigating from a wire to a node
- Navigating across a structure
- Navigating between the front panel and the block diagram of a VI
Creating VIs and VI Objects
- Creating a new blank VI
- Creating a new VI from a template
- Adding objects to a front panel or block diagram
- Copying an object
- Creating a constant, control, or indicator from a terminal
- Adding, duplicating, and removing frames of a structure with multiple diagrams
- Wiring objects to other objects
Inspecting and Editing VIs and VI Objects
- Configuring a connector pane
- Moving an object
- Replacing an object
- Deleting an object
- Selecting objects to cut, copy, and paste
- Interacting with the label of a node
Miscellaneous
- Undoing actions
- Block diagram cleanup
- Using object tags
- Showing the front panel or block diagram of a VI
- Closing references
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:
- Control:Terminal —Allows you to navigate from a front panel control to its corresponding terminal on the block diagram
- ControlTerminal:Control —Allows you navigate from a block diagram control terminal to its corresponding front panel control
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.
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.
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.
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:
- VI:Transaction:Undo
- VI:Transaction:Redo
- VI:Transaction.Begin Undo
- VI:Transaction.End Undo
- VI:Transaction.Fail
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.
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.
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:
- Front Panel:Open
- Front Panel Window:Window Bounds
- Block Diagram Window:Open
- Block Diagram Window:Window Bounds
- Block Diagram Window:Origin
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.
In This Section
- 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
- Creating a New Blank VI
- Creating a Constant, Control, or Indicator from a Terminal
- Adding, Duplicating, and Removing Frames of a Structure with Multiple Diagrams
- Wiring Objects to Other
Objects
- Moving or Copying an Object
- Replacing an Object
- Deleting an Object
- Selecting Objects to Cut, Copy, and Paste
- Interacting with the Label of a Node
- Undoing Actions
- Block Diagram Cleanup
- Using Object Tags
- Showing the Front Panel or Block
Diagram of a VI
Related Information
- Obtaining a VI Reference
- Obtaining References to Objects in an Unknown Target VI Using VI Scripting
- Obtaining References to Objects in a Known Target VI Using VI Scripting
- Navigating from a Node to a Wire Using VI Scripting
- Navigating from a Wire to a Node Using VI Scripting
- Navigating across a Structure Using VI Scripting
- Creating a New VI from a Template Using VI Scripting
- Adding an Object to a VI Using VI Scripting
- Configuring a Connector Pane Using VI Scripting
- Closing References to VIs and VI Objects Using VI Scripting
- Tutorial: Creating and Opening a VI Using VI Scripting
- Tutorial: Wiring Objects Using VI Scripting