LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Input array to tree control and selected items - to output array

Hi,

 

I'm new to LabVIEW and any help will be appreciated.

 

I would like to create VI with a tree control which receives an array of tests, displays this array as tree and returns an array of tests selected by user.

The input array is as following:

 

Module1 Test1

Module1 Test2

Module1 Test3

Module2 Test4

Module2 Test5

...

 

The tree should be as below:

+ Module1

           Test1

           Test2

           Test3

+ Module2

           Test4

           Test5

 

A user may select more than 1 test (using a mouse + Ctrl or Shift).

If a user selects a module (expanded or not expanded), then all tests of this module are selected (it's not must, but nice to have option). 

For example, a user selected Module1->Test1 and the whole Module2. The output array should be as following:

 

Module1 Test1

Module2 Test4

Module2 Test5

 

Can anyone please give an example of how to do this.

Thanks in advance.

 

 

 

0 Kudos
Message 1 of 8
(5,514 Views)

For setting up the Tree you have to use property nodes and invoke nodes. This can become a bit tricky. Selecting mode for items can be configured in the context menu. For start see example VI.

 

For the desired extended you need to check whether a parent item or all child items are selected. To start this process you can detect the events generated by the Tree control. Tip: use the child tags to detect which element belong to which group. But the rest will be your job.

 

Example is in LV 8.6

Message Edited by Jörn on 2009-11-15 15.11.2009 04:20 PM
Message 2 of 8
(5,509 Views)
Thanks.
0 Kudos
Message 3 of 8
(5,487 Views)

Hi,

 

If I wanted to create a tree control from a 2D array of strings containing data such as:

parent1 child 1

parent1 child 2

parent1 child 3

parent2 child 1

parent2 child 2

parent2 child 3

etc...

 

I basically have over 500 "child" entries and about 20 different "parent" entries I will be getting the list from a sql server and bringing it into LV as a 2D string array, is there a way to take this array and convert it into a tree control?

 

Thanks In advance

0 Kudos
Message 4 of 8
(5,107 Views)

Well, I believe that I may have solved my own problem. If interested, here is an example of what I did.

 

 

0 Kudos
Message 5 of 8
(5,100 Views)

The vi will run properyly provided the size of the "ParentColumn"  and the "#ChildperParent" array are same... or else you may end up with some issues

Regards
Guru (CLA)
Message 6 of 8
(5,096 Views)

I have a similar problem which has been bugging me for several days..  It will be greatly appreciated if you can re-post the example in Labview 8.5.   Thanks

0 Kudos
Message 7 of 8
(5,037 Views)

Here's that example in 8.5:

 

0 Kudos
Message 8 of 8
(5,022 Views)