LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I "clean up" a Project?

I have been developing a RealTime data acquisition/control system using LabVIEW 8.5.  I am using Project to help "manage" the VIs (it is especially useful when I want to test the "remote" VI that runs on the PXI -- just create a new target and drag the remote VI to it).  I currently have 165 VIs and sub-VIs in Project.

Needless to say, as the code has evolved, a number of the VIs in the Project became "obsolete" (in that they are no longer called by any of my "active" top-level VIs).  I'm looking for a way to (a) identify the VIs which now are "orphans" (no callers), and (b) to remove them from Project.  Note that they are all essentially in the "Dependencies" part of Project, where right-clicking them does NOT bring up an option "Remove from Project".  In fact, the only way I know to remove an object is to drag it out of Dependencies, right-click, and choose Remove from Project.  I don't want to do this to 165 VIs!  Suggestions (and "education") welcome.

Bob Schor
0 Kudos
Message 1 of 13
(7,132 Views)
Hi Bob,

The way I used to do things like this was to create a Development Distribution.  

In 7.1, I'd open my top level VI and use the Save with Options dialog to save that top level VI and all the ones it called to either a new folder or a .dll file. 

In 8.5, the Save with Options dialog is no longer there.  But you can use the Project Explorer to build a source distribution.   Right-click on Build Specifications, and select Source Distribution. 

I'm not sure if there's a way to have LabVIEW automatically select all the relevant files for you.  If there is a way, (probably is) I haven't figured it out yet.   

 


---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 2 of 13
(7,116 Views)

"I'm not sure if there's a way to have LabVIEW automatically select all the relevant files for you.  If there is a way, (probably is) I haven't figured it out yet."

Using a Tree.VI coupled with pallen's comments goes a long way, see here to see Greg McKaskle's post on this subject.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 13
(7,076 Views)

I agree with Ben.  For instance, what happens when you use Dynamic VIs?

RayR

0 Kudos
Message 4 of 13
(7,067 Views)

You should try this great tool: "Find Used & Unused VIs Utility..."

You can find it on the LAVA forum at the address: http://forums.lavag.org/Find-Used-and-Unused-VIs-Utility-t17.html

It show all the VI used or not used in a folder (and sub folders).

Give it a try, you will love it !

Message 5 of 13
(7,055 Views)

"Find Used & Unused VIs Utility" is works great, I remember someone passing it to me.

 

But to add to the suggestions, there is a "Applications:Exported VIs In Memory" property that list all VIs in memory. (Maybe the Find Used...Utility reuses this.) Open your top level VI, open a new VI run the property sort the array list. Now you have a list of VIs to compare to Project VIs that are in memory. I have a prefix naming scheme so its easy as possible to know what VIs do what. This won't find dependent (non VI) file or dynamic callees.

0 Kudos
Message 6 of 13
(6,609 Views)

@BOB Schor wrote:
In fact, the only way I know to remove an object is to drag it out of Dependencies, right-click, and choose Remove from Project.  I don't want to do this to 165 VIs!  Suggestions (and "education") welcome.

That really makes no sense. VIs listed in dependencies are VIs that are not explicitly part of the project, but VIs in the project depend on them. If they only show in dependencies, that still ARE dependencies, else they would not be listed. You can right-click and ask "Why is this item in dependecies?" to get more information. Try it!

 

Sometimes I have non-autopopulating virtual folders, and a relatively easy way to purge all no longer needed VIs is to temporarily remove them all from the project, at which time the still needed items will show up in depedencies, while the no longer used ones will not. Then I drag them back from the root of dependencies (i.e. not vi.lib) to the same virtual folder they were located earlier. Takes only seconds.

 

0 Kudos
Message 7 of 13
(6,598 Views)

Altenbach wrote:

"Sometimes I have non-autopopulating virtual folders, and a relatively easy way to purge all no longer needed VIs is to temporarily remove them all from the project, at which time the still needed items will show up in dependencies, while the no longer used ones will not. Then I drag them back from the root of dependencies (i.e.. not vi.lib) to the same virtual folder they were located earlier. Takes only seconds."

 

Yes this the fastest way! Maybe you meant autopopulating folder, since non-auto would require a refresh to update missing files and it appears to not list missing files in dependencies list on refresh. Using Auto-populating works OK, you know immediately as mentioned.

 

About files in the project, another gotcha is files that are a member of the project but not actually being used for anything (thus this thread, the reason to clean up the Project). I've noticed when you use the Files tab to move/delete files LV doesn't put deleted files in the recycle bin or trash can. That deleted files is now not in the project but it persist on the actual folder where the actual folder path is same as Virtual path of a project. I always on the side that deleted file should go to the recycle bin and not stay in the project folder to create clutter!

0 Kudos
Message 8 of 13
(6,587 Views)

@altenbach wrote:
Then I drag them back from the root of dependencies (i.e. not vi.lib) to the same virtual folder they were located earlier. Takes only seconds.


Only if you only have a few items in the project and in the dependencies. That's rarely the case for me. While I don't have every VI in the project in the tree, there will still usually be quite a few of them which I want easily accessible.


___________________
Try to take over the world!
0 Kudos
Message 9 of 13
(6,569 Views)

richjoh wrote:

About files in the project, another gotcha is files that are a member of the project but not actually being used for anything (thus this thread, the reason to clean up the Project). I've noticed when you use the Files tab to move/delete files LV doesn't put deleted files in the recycle bin or trash can.


It's on purpose. See the comments here - http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Restore-quot-Delete-from-Disk-quot-in-project-Files-vi...


___________________
Try to take over the world!
0 Kudos
Message 10 of 13
(6,568 Views)