Example Code

1. Partridge in a Pear Tree - Tree Control

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Download All

Overview
This example shows how to create a tree control from XML (eXtensible Markup Language).
Description
The VI begins by clearing the tree control, creating the column headers and setting up some custom symbols. It then iterates through the XML structure, creating new tree elements each time. Finally, we set the state of the symbols and wait for mouse events,

when we change the symbol state again. To exit the VI, simply try to close the window. This is implemented via the "Panel Close?" case in the event structure and discards the command to close LabVIEW itself while the VI is running.

 
Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Unzip “Partridge 2012 NIVerified.zip”
  2. Open “Partridge 2012 NIVerified.lvproj”
  3. Run  " Partridge.vi"

 

Additional Information or References
VI Block Diagram

 4-538.png

 **This document has been updated to meet the current required format for the NI Code Exchange.**

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

Comments
CharlieM
Member
Member
on

This is a very good example! One that I was looking for about a month ago. If anyone knows of other LabVIEW, XML, Tree Control examples, please post them.

Merry Christmass!

Charlie M. CLD