Example Code

Getting Child Items in a LabVIEW Tree Control

Code and Documents

Attachment

This example shows how to obtain the child items of a specified parent item in a LabVIEW tree control.

You can use the example as a subVI that takes inputs of a tree control reference and a parent tag and returns an array of child tags.


1. Create a top level VI that contains tree control with at least one parent item that contains one or more child items.
2. Place the GetChildren VI (this VI) on the block diagram of the top level VI.
3. Create a reference to the tree by right-clicking the tree control and selecting Create»Reference.
4. Wire the reference to the Tree Reference In input of the GetChildren VI.
5. Place a string control on the front panel and type the parent item in the tree control whose children you want to return and wire the control to the Parent Tag input of the GetChildren VI.
6. Create an indicator from the Children Tags output of the GetChildren VI.

Run the VI and observe that this subVI returns all of the child items of the parent item in the tree that you referenced.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors