LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use an example "tree" VI

Highlighted

I found a sample VI called FamilyTree.VI (attached) through the Find Examples search engine (key word was tree).  This VI uses calls to an  LLB.  This does close to what I want and plan on using this as a base for my application, of which I have figured out by trial and error how to reconfigure the example for my needs....... since there appears to be no documentation for the LLB functions.

 

Question 1: Does the fact that this VI uses the LLB limit what and how I use my application in the future?  If I want to generate a distributable EXE in the future, will these features limit that distribution or limit the computers it can be used on?

 

Question 2:  I want to save the tree I develop within my application to be called for edit at another time.  Note that the example uses a fixed array as input but, I assume,  I can use any array that is configured properly.  So how can I save the tree I am generating to an array to be recalled later?  I see no direct way of doing this.

0 Kudos
Message 1 of 6
(1,160 Views)
Highlighted

For 1: In essence, no. When you build an application, whatever VIs that are used get compiled into the application. The application at that point is standalone. The VIs in the example folder are the same as the ones in the vi.lib folder. They're there for your use. In general, though, if you find a VI that's in the example folder it's best to copy it (and any associated subVIs) into your own project's folders so that you can be sure to have the VIs. That way, if the VIs change, or are deleted in future versions of LabVIEW, you will still have a working project.

 

For 2: Yes, you can use any array you want. That was just an example. As far as saving it, there's lots of options, depending on the scope. You could simply save the tree items in a file, and at the start of the program simply read in this file. There are numerous file I/O functions that you can use. For example, you could use the Write To Spreadsheet File and Read From Spreadsheet File VI. Or, you could use the configuration VIs if you want to write out the tree items in an .INI file format. Or, you could write them out as an XML file. Or... like I said, lots of options. Smiley Wink

0 Kudos
Message 2 of 6
(1,146 Views)
Highlighted

Thanks smercurio_fc ,

 

Here an added dumb part of my original question..... I probably will save the data to a spread sheet but,  where in the heck do I get to the tree's contents.  It doesn't update the input array as you edit, so I can't get to it there. I can't find a function that provides a dump for the tree contents.  I can't find an output line on the VI icons where it may be hiding, etc    This is where it would be helpful for some extra doc's on these example VI's because I simply can not determine where the data is at and it is probably pretty simple. 

 

With a great deal of trial and error I have gotten the example working the way I want it to but I am definitely striking out with this last issue.

 

0 Kudos
Message 3 of 6
(1,127 Views)
Highlighted

There isn't a single "export" operation for the TreeView control. You have to iterate through the tree and get the elements out one by one.

 

Keep in mind that the example is using Microsoft's TreeView ActiveX control. You may wish to consider using LabVIEW's built-in tree control. It doesn't have an export feature either, but it is native, so you don't have to worry about needing to have the ActiveX control installed on a target machine. The "Directory Hierarchy in Tree Control" is an example that uses LabVIEW's native tree control.

0 Kudos
Message 4 of 6
(1,124 Views)
Highlighted

I used the TreeView control.  I looked at the native option and figured I would have to write the delete and add-in functions etc. that are already in the TreeView example. Right now I do not want to do that however, I probably will when everything else is complete.

 

Thank you for the help.

 

If it were not for the access to the Lib VI's and your help I could never have figured out to accomplish the goal, there is simply not the docs needed to do it.

 

Thank you. 

0 Kudos
Message 5 of 6
(1,099 Views)
Highlighted
Since the TreeView control used in the Family Tree example is a Microsoft ActiveX control the documentation would not be in the LabVIEW documentation. MSDN would be the source of documentation for that control.
0 Kudos
Message 6 of 6
(1,095 Views)