LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array to Tree

Hello Every one,

               Can any one please please help me out. Iam trying to display a 2-D array in a form of tree and latter split them in to 2- different 1-D arrays.

The 2-D array is of the following form, the first column is the group and the remaining other columns are the group elements. The tree should represent all the groups defined in the 2-D array. If we click the plus (+) sign it should display all the elements in side that group. As shown in the attached vi.

After displaying them in to a tree I need to split the group elements in to two different 1-D array's(because this two arrays is used for other part of my program)

A switch control is provided, which has 2- modes test-1 and test-2.

When the switch is in test-1 mode and if we double click a group element in the tree that element should be copied to test-1 array, similarly if the switch is in test-2 mode and if we double click a group element in the tree that element should be copied in to test-2 array.

 

Iam attching my vi, which only contains what controls and indicators Iam trying to use.

 

Thanxs in advance

0 Kudos
Message 1 of 7
(4,039 Views)

Here's a start; it'll load your tree.

 

19723i918CD7C31CAF1A2C

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 2 of 7
(4,016 Views)

 


@Raghu123 wrote:

 

[...]


A switch control is provided, which has 2- modes test-1 and test-2.

When the switch is in test-1 mode and if we double click a group element in the tree that element should be copied to test-1 array, similarly if the switch is in test-2 mode and if we double click a group element in the tree that element should be copied in to test-2 array.

 


What should be copied into the "test-1" and "test-2" arrays?  Those are arrays of doubles and you'll get strings from the Tree Control.  It will be easy enough once you help me understand the requirements.

 

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 3 of 7
(4,015 Views)

Here's what I'd do quickly if the arrays contained Strings.  I'm thinking that the larger scope of the program should be written as a State Machine or some logical sequencer.  I'd use the JKI State Machine, myself.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 4 of 7
(4,012 Views)

Jim,

    Thank you for replying to my post. The idea of my work is to develope a user friendly GUI for a testing application.


Jim, I was working with this vi and added few more things like displaying additional data in the column's 2 & 3 and deleting a repeated word if it is double clicked twice etc.I could achieve to some extent, but have some issues with filling the data in the second column. Actually the values in the second column will be updated during run time, so I want to feed the run time data array to this column. If I place the array in the while loop then the program will have 2-while loops(one for double clicking logic, one for run time data logic) so Iam in a confusion what to do. Can you please fix my problem.

    Also Jim can we display the tree in a additional front panel instead of my main vi? Like providing a button in the front panel for the user, if he clicks it, a window pops out and dispalys the tree which allows him to select the group elements by double clicking.

 

Thank you.

0 Kudos
Message 5 of 7
(3,964 Views)

Hello Jim,

 

Can you please help me out in fixing this 2- issues.

 

1) Feeding a run time data array to column -1 and 2) Providing a push button in the front panel which allows the user to click on it, so that another front panel pops out, which has the tree logic.

 

-Thank you.

0 Kudos
Message 6 of 7
(3,909 Views)

Using a subVI front panel might help you modularize this. You could call the subVI in an event structure and have it's front panel pop up when it is called. The LabVIEW help mentions how to do this here. I hope that helps you get started.

Verne D. // Software R&D // National Instruments
0 Kudos
Message 7 of 7
(3,890 Views)