Common VI Scripting Tasks

LabVIEW 2018 Help


Edition Date: March 2018
Part Number: 371361R-01
View Product Info

DOWNLOAD (Windows Only)


LabVIEW 2015 Help
LabVIEW 2016 Help
LabVIEW 2017 Help
LabVIEW 2018 Help
LabVIEW 2019 Help

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:

  • 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:

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:

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.

WAS THIS ARTICLE HELPFUL?

Not Helpful