Obtaining a VI Object Reference Using VI Scripting
- Updated2025-08-15
- 2 minute(s) read
Requires: VI Scripting
When you use VI Scripting to inspect, modify, or create front panel or block diagram objects, you must obtain a reference to the object with which you want to interact. You then can wire this reference to Property Nodes or Invoke Nodes to get or set information about the referenced object.
Refer to the following list to identify the best way to obtain a VI reference for your specific use case. The approaches in the list increase in difficulty.
- Use the Open VI Object Reference function. The Open VI Object Reference function allows you to search for a specific object in a target VI by its label. Use this approach when you want to obtain a reference to an object in a target VI with known contents, such as a template VI.
- Use the Traverse for GObjects VI. The Traverse for GObjects VI allows you to search for all objects in a target VI that are instances of a specific class. Use this approach when you want to obtain references to objects in an unknown target VI. Also use this approach when you want to interact with multiple objects in a target VI that are instances of the same class.
- Navigate the connections among objects within the target VI. Navigating connections among objects within a target VI allows you to use a reference to one object to obtain references to connected objects. Use this approach to obtain a reference to an object that you cannot access directly with one of the previous approaches.
Caveats and Recommendations
- Close all references that you open. An excessive number of open references negatively impacts the performance of a VI. Read about closing VI and object references for more performance details.