LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting total VIs count in project

Hi,

 

I want to get number of VIs count in a project.

I am trying to see VI metrics metioned in following link:

http://www.ni.com/en-in/innovations/white-papers/06/estimating-code-complexity-in-labview.html 

 

I didn't find option in my LabVIEW 2016 PDS 😞 😞 

 

Is there any way to get exact count of total VIs involved in project ?

0 Kudos
Message 1 of 4
(3,506 Views)

You can use VI scripting to find this information. The Project class for a Property Node contains a "MyComputer" property, although if you're on multiple targets you'll need to also recurse through the list of targets.

 

From that reference, you can find Owned Items, and proceed via other property nodes to check the type (VI, library etc) and then check their owned items if they are containers (like a library).

 

This is probably more easily accomplished with a more structured set of VIs, perhaps using OOP, but someone might have already written exactly the code you're looking for. Otherwise, it can be done with a shared-clone VI, but you need to be careful for nested libraries, etc. If it isn't a VI or control/typedef or similar, and you want the total number of VIs, you need to keep going.

 

Edit: If you don't need this programmatically, you might be able to just export the list of files in the project (Project > File Information) and then read that exported list and count the elements (possibly after filtering based on names ending with .vi - this list contains anything in the project, and nothing in dependencies if I'm reading it correctly).


GCentral
0 Kudos
Message 2 of 4
(3,491 Views)

There are several ways to do this, depending on what you want to do.  At one point, I wanted to get a list of all the VIs in memory, as there were some that weren't shutting down properly and I wanted to locate them (so I'd know what to fix) and also programmatically force them to stop.  Here is a little routine that I wrote first that just lists the VIs in memory:

Show All VIs in MemoryShow All VIs in Memory

Bob Schor

Message 3 of 4
(3,477 Views)

I published a free utility that displays the entire project in a single window with up to 42 properties including code complexity.  It displays the number of objects displayed and can also show the count separately for VIs, Controls, Typedefs and Strict Typedefs.  You can show the project items selectively by 17 object types.  It can combine multiple targets or just show My Computer.

http://free.propinsp.com

 

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 4 of 4
(3,449 Views)