This example VI opens all front panel objects in another VI. It compares the Class ID and Label of each one of these against the control reference and label specified at the front panel of the example VI, so that those matching change their value to another one.
With Property nodes we can get or set properties and methods on local or remote application instances, VIs, and objects. This example VI receives a VI path to get all its front panel objects and, for the ones that fit the Class ID (an integer which uniquely identifies the class of a LabVIEW object) and label, to change their value to one specified in the "Value" control of this example's front panel.
Use this example to understand how to programmatically manipulate properties of controls and indicators using the VI server hierarchy classes and references, alongside property nodes.
NI LabVIEW Base Development System 2012 (or compatible).
4. Steps to Implement or Execute Code
Download and open the VI
Modify the value of the "VI to edit" file path control to point towards a VI you want to programmatically modify.
Write in "Label" the label of the object/control you want to modify from the called VI's front panel.
Right click the "Control Ref" control and browse to Select VI Server Class > Generic > GObject > Control and select the class you want the code to look for and modify.
Write in the "Value" string controls the value you want to assign to the class selected. Important note: You must change the data type for the control "Value" to fit the type of control reference you want to manipulate (for example: choosing a Boolean control reference will break the code and you'll have to change the "Value" string control to a Boolean string control).