LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to programmatically get the list of VI dependencies?

Solved!
Go to solution
I need to get the list of all subVIs (and all their subVIs, etc.) for a VI programmatically.  Surely someone has already done this, right?  I've tried creating a recursive VI that uses the Callees property node.  But this only gives me the name of the subVI, not the full path to it.  I'm also getting duplicate entries for each clone VI.
0 Kudos
Message 1 of 10
(5,148 Views)

Use the names to open references to the VIs, and from them get the paths.

0 Kudos
Message 2 of 10
(5,146 Views)
But that's just the problem -- I can't open the VI ref because I don't know the path to the VI.  All I have is the name.  Some of the leaf VIs are NI VIs and I have no idea where they are ...
0 Kudos
Message 3 of 10
(5,144 Views)
If the VI is in memory, you don't need the path. Just wire the name into the path input on the Open Reference function and it'll work...
0 Kudos
Message 4 of 10
(5,142 Views)
Sounds simple but that doesn't work for me.  Here's my VI.  What am I doing wrong?
0 Kudos
Message 5 of 10
(5,140 Views)

On the first (top-level) VI, you use the path to get a reference.

 

Thereafter, use the name string (not a string cast into a path) of a VI to open its reference. Just wire the string directly into the "vi path" input of the Open Reference. Use that reference to get the path if you want it, but you actually don't need a path to get a reference to a VI (except for the top-level)

 

You do not need to use recursive calls to do this; just a while loop.

 

I have to run or I would try to write it for you. Good Luck.

0 Kudos
Message 6 of 10
(5,134 Views)

OK, that fixed it so that the recursive calls would drill all the way down the tree.  Now I get the full list of VI dependency VI names, but I still need the paths as the output.  What I'm doing is FTPing the VI and its dependencies to an RT target (the VI server didn't do this for me because I'm not deploying the VI -- it's loading at runtime).

 

0 Kudos
Message 7 of 10
(5,122 Views)
Solution
Accepted by RavensFan

I may not be understanding you properly, or I may be missing something. But you are opening VI references to every VI in the Callees chain, right? So you can get the VI Path from a property node.

 

If you can post what your code looks like now then I can try to see if I am missing somthing.

0 Kudos
Message 8 of 10
(5,102 Views)

Finally got back to this.  Yes, using the VI Path prop node worked.  FYI here's the complete VI.

Thanks for your help!

 

Message 9 of 10
(5,040 Views)

Stumbled across this and it was exactly what I needed, thanks!

0 Kudos
Message 10 of 10
(4,049 Views)