LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

adding a element to last node of tree

Solved!
Go to solution

iam just learning programming in labview. some one help me. I want to develope a tree so that when ever a new element is detected in the input array(parent -> array name) a new node should be created in the tree, below the last node , also adding the child nodes in the tree taking corresponding elements form the  child array.

 But my vi is creating nodes once again taking elements from the starting of the array. can any one please fix this.

0 Kudos
Message 1 of 15
(4,378 Views)

Because you have a while loop around the major part of your code that builds the tree that runs as quick as possible until someone presses the stop button.

 

Perhaps you want to use an event structure that detects changes in either of the two arrays, and when that happens the tree building executes one time, but starts at the delete tree again to blank it out.

 

What is the ultimate purpose for this tree?  Is it going to be used as a control for some other critical part of your program?

0 Kudos
Message 2 of 15
(4,374 Views)

Ravens Fan, this will be only as a indicator. Its not going to be a control for my other part of program.

0 Kudos
Message 3 of 15
(4,368 Views)

Hi sulekha,

Can you post your code in Labview 8.5 ?

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 4 of 15
(4,337 Views)

I can not open your code as I am using labview 8.5. You can even post .JPG file of your Block diagram

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 5 of 15
(4,337 Views)

Here is in labview 8.5 version.

0 Kudos
Message 6 of 15
(4,326 Views)

Hi sulekha,

You need to use an event structure. Use "Value Change event".

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 7 of 15
(4,311 Views)

Gak, pls bare with me  Iam new to labeview,even though Iam using the evnt structure with value change event in it, still seeing the same result and more over Iam unable to stop the vi when i hit the stop button. Can u pls let me know how to insert the event structure inside the while loop. I think Iam missing some thing because vi is not even allowing me to stop the execution.

0 Kudos
Message 8 of 15
(4,297 Views)

You may want to include a timeout event in your event structure.

 

- Greg J

0 Kudos
Message 9 of 15
(4,289 Views)

Hi sulekha,

Check this example.

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 10 of 15
(4,265 Views)