From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

how can i pass a tree to another vi?

I have a vi which reads a file and builds up a tree control, i now want to pass that tree structure to another vi, but when i pass it, it has no effect on the tree in the vi which i am passing it to...

can the tree structures not be passed or referenced somehow???

Thanks for any help
0 Kudos
Message 1 of 3
(3,009 Views)
Currently, there is no way to directly pass a tree directory from one tree control to another tree control or indicator. The tree control output is a string that shows a highlighted item in the tree's directory. There are no properties or methods available in Labview to pass the entire directory at one time. In order to transfer a tree directory to another control or indicator, you will have to reconstruct the entire directory either by hand or programmatically.

To do this programmatically, you will want to use a combination of property and invoke nodes. The property nodes will be used to count the number of rows and set active items in the directory. The invoke nodes will be used to identify the parent and child items in the directory of the original tree(
using the methods in the Navigate Tree submenu) and then rebuild the new tree (using methods in the Edit Tree Items submenu).

I have attached an example program below that I think will answer your question and illustrate this feature.

Good luck!

Kileen Cheng
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(3,010 Views)
Hi Kilean,

I'm trying to develop an application in which the user could enter input parameters in a hierarchical fashion... such as in a tree diagram. I then want to be able to transfer the values in the  tree into an array so that actions could be performed on the input.  I understand based on your prior correspondance which I've read that this isn't possible as such... but that the tree would have to be "re-created".  I'm trying to use the example which you've given... but it doesn't seem to do anything!

Please let me know whether I'm missing something.

Thanks,
Jason
jason@golan.ca
0 Kudos
Message 3 of 3
(2,916 Views)