LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tool to analyze dependendies

Hi!

 

I have a really huge project, and would like to break it apart into subprojects. Though there is in general a strong hierarchy, there are still many cross-dependencies I'd like to eliminate.

 

LV can show me that a VI depends on an other class, but it does not tell why. I have to analyze the VI carefully, until I find a cluster which contains a typedef from that other class deep inside. This is very time-consuming, and undoable for hundreds to thousands of VIs.

 

So, is there a tool to point me more directly to any dependency?

0 Kudos
Message 1 of 5
(506 Views)

Hi Sebastian,

 


@Sebastian.Weber wrote:

 I have to analyze the VI carefully, until I find a cluster which contains a typedef from that other class deep inside. This is very time-consuming, and undoable for hundreds to thousands of VIs.


You can also show typedef dependencies in the hierarchy window…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 5
(491 Views)

Hi Sebastian,

 

AFAIK there isn't a dependency tool that does what you need, even though such a tool would be very useful.

 

A technique that might help is: Move a subfolder that contains a class an all its member VIs to a different location (for example to the desktop). Create a new, blank project, saved also to the desktop (or any location different than the original project). Add the moved class to the blank project. Open the VIs of the class. The VIs that depend on other classes will be broken, because LabVIEW should be unable to automatically find the other classes from the original project. You can then click on the broken run arrow repeatedly to navigate to the places in the block diagram where the code is broken (where dependencies are missing).

0 Kudos
Message 3 of 5
(391 Views)

There is a "secret" (i.e. private) method using the LabVIEW linker, listed here:

 

https://labviewwiki.org/wiki/Application_class/Linker.Read_Info_From_File_method

 

If you run it on a file with the "recursive" option set to True, it lists all dependencies (which you already have access to) but more importantly, each cluster entry in the array output has an array of "links" in it, which is a list of all other array indexes that it links to in the same output list. 

 

So if you run that on your top file (or files), then find the array index of something you don't want as a dependency, you can then iterate over the list to see which other elements in the list have its index in their "links" array.  That will be the exact file(s) causing the dependency.

Message 4 of 5
(362 Views)

Download Property Inspector 4.1 from the NI Tools Network or the link in my signature.  Then watch my youtube video on deleting dead and orphan code.  It finds all code with no callers.  You will find a surprising amount in your project. 

 

Then you can use it to select a group of code and find all callers of all that code.  It even finds all the callers of all those callers.  You should be able to find entire classes that are only called by 1 or 2 other classes.  You can even export the results to Excel for reference.

Michael Munroe, CLD, CTD, MCP
Automate 1M+ VI Search, Sort and Edit operations with Property Inspector 5.0, now with a new Interactive Window Manager!
Now supports full project automation using one-click custom macros or CLI.
0 Kudos
Message 5 of 5
(342 Views)