Example Code

LabVIEW - Tree Control - Save and Restore the Status of a Heirarchy

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

Overview

This example demonstrates how to store and subsequently retrieve the hierarchy of a tree control.

 

Description

Example Code Developed by James Baker - Amfax Ltd

The following community example demonstrates how to store and subsequently retrieve the hierarchy of a tree control.

The code uses a state machine with events to allow the user to; randomise the tree status, save the current status and restore a saved state.  It does this using the ActiveItemRowNumber and Open? properties.

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Run the VI.
  2. Click on Randomise Tree to randomise tree structure.
  3. Click on Save State to store and display current hierarchy.
  4. Click on Restore Sated to restore the previously saved hierarchy.

 

Additional Information or References  

Front Panel

2.PNG

 

VI Snippet

1.png

 

 

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


Regards,

Peter D

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