LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

programmatically list a VI's dependencies (subVIs) recursively

Solved!
Go to solution

In a large application I am developing I use VI Server calls to load VIs into memory. However, I recently came across a problem which is causing a bit of a headache. I've been able to successfully load and execute, using VI Server, a series of VIs (which are kind of like plugins). That is, all except for one. This odd VI loads up, gets its front panel inserted into a subpanel control, but is reportedly Execution State = Bad. According to the help, this means the VI is broken and cannot run.

 

Now, my supporting framework ensures that missing dependencies are requested when loading a VI using server calls, ie if a dependency cannot be found the familiar Browse dialogue appears, and indeed during development I've seen this happen a number of times. Therefore I know this latest VI is not missing any dependencies because it doesn't ask me to point it to any, and I know the VI should be working because it opens and executes fine when running in the development environment.

 

So, what I figure I need to do is programmatically determine which of the VI's dependencies (subVIs) are at fault. I've not done this before so I'm not sure where to start, I guess scripting will be necessary, but:

 

Is there an easy way to programmatically list a VI's dependencies (subVIs) recursively?


With such a list I should be able to examine each for the one(s) that are broken and get to the bottom of this conundrum. I'm hoping there are some unpublished codes that ship with LabVIEW I can harness for this.


Any help most appreciated!

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 1 of 7
(5,040 Views)
Solution
Accepted by topic author Thoric

The easy way to do this is use the VI method Get VI Dependencies.  It has an option to return the entire tree, so you don't have to iteratively recurse through the entire thing.  However, this method is relatively new.  It replaces the old Callees property, which must be used recursively.

Message 2 of 7
(5,033 Views)

I found a scripting subVIs[] method which returns the top-level subVIs of a Diagram ref, which I could call recursively to build a tree, but I couldn't find Callees nor Get VI Dependencies. There's no mention of them in the LabVIEW help, where should I be looking for these?

Thoric (CLA, CLED, CTD and LabVIEW Champion)


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

tools>>Options>>VI Server>>VI Scripting.  Check both boxes to show scripting functions in the RKM and help


"Should be" isn't "Is" -Jay
Message 4 of 7
(5,020 Views)

Both of these are public, non-scripting, methods, so should show up in the selection list if you drop a method or property node and select the VI class or wire a VI ref to them.  Use the class browser (Ctl-Shift-B) to search for them in the VI class.  Callees is actually Callees' Names.

 

What version of LabVIEW are you using?  I only went back to 8.6, and the public/private status may have changed.

Message 5 of 7
(5,018 Views)

Thanks!

I was stupidly looking at a VI Properties node, not Method node, so I couldn't see it. Not sure why it doesn't appear in my help though, as I have those checkboxes ticked in Options. Maybe I mistyped something...

 

Anyways, that's great, thank you both! Smiley Happy

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 6 of 7
(5,014 Views)

Thanks for the correction.

 

Located here in help (2011)

 

Invoke node>> select class>>VI Server>>VI>>VI


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 7
(5,011 Views)