There are two things you can do to speed this up. One is to use the "Defer Panel Updates" property of the Panel to turn off updating of the panel until the entire tree is populated. After the tree is populated, you would then disable Defer Panel Updates. This is a property of the Panel class, so you can search the LabVIEW Help for "Defer Panel Updates" to learn more. It basically involves putting a property node before and after your tree population code.
Another thing you can do is add all the tags to your tree at once with the "Add Multiple Items to End" method of the tree control. This is a new method for the Tree in LabVIEW 8.0, and my understanding is that it is much, much faster at adding items to a tree than doing it one at a time. Again, check the LabVIEW Help for more information about this method.
Hope this helps,
This doesn't sound right at all. When updating a Tree control without defer panel update enabled you spend a large amount of your time in redrawing the tree control. So using defer panel update should definitely get you more time savings. However there is of course another time delay here if you seem to use an SQL database to get the values. SQL queries can get very slow if not down with paramtrized queries or such, so you might want to look at that part as well.
Thank you Darren for quick answer. The "Defer Panel Updates" property reduced the tree population time about 0.5 minute. So it is still above 3 min - too long.
I tried the "Add Multiple Items to End" method but without success. I can not find any example with this method. Also in LabVIEW Help is not enough info about it .
Dear Jarrod and the others,
I took your VI and I tried to modify it a little bit for one of a customers. He noticed the problem discussed in this post. He is working with LV 7.1 and thus, he knows he can't employ the properties 'Add multiple items at a time'. I rewrote the VI for him and tried to do the little modifications he want... But I can't do that and I'm afraid....
He want to do that : The tree is created without front panel update. The user checks the correct parent and select it by a double-click (who is linked to an event structure). Then the program rewrites the tree with only the selected parent and his children. I do that but it's not completed because I can't find the position of the selected item !
Anyone of you can help me???
Thanks a lot,