LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Most efficient way to clean a project

I have a large project that wrote several years ago. I have been the sole writer, contributor and maintainer of this project. I have made several changes and improvements over the years, Usually making a new copy of a sub-vi before modifying it. So now I have several years worth of older vi versions in my project hierarchy.

 

What is the most efficient way to clean this project so the hierarchy only contains sub-vi versions that are currently in use? 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 1 of 9
(154 Views)

I've resorted to creating a source distribution, then making a new project in the output folder.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 2 of 9
(147 Views)

I once wrote a VI that did the following:

 

1. Took in a list of "Main" VIs present in a project (which could be just one)

2. Got a list of all dependencies of that VI recursively

3. Made sure to include any files that were dependencies by association (such as all class members, all possible descendant classes)

4. Went through the list to ensure it was a complete list of files on disk (for instance, if a file was in a LLB, it only referenced the LLB file)

5. Compared that list against a defined root folder on disk, disregarding any located elsewhere

6. Got a recursive file listing of that same root folder on disk

7. Looked for any files that were in the root folder but not in the list of dependencies on disk

8. Took the list of all those files and deleted them.

 

I would then close everything, re-open the main project and main VIs, and confirm that none of the main VIs were broken or searched for files on startup.  If anything was reported as missing (somehow having passed through all the scripting and filters) I would restore it from source control.

 

(If you don't have source control, start using it!)

Message 3 of 9
(129 Views)

@RTSLVU wrote:

I have a large project that wrote several years ago. I have been the sole writer, contributor and maintainer of this project. I have made several changes and improvements over the years, Usually making a new copy of a sub-vi before modifying it. So now I have several years worth of older vi versions in my project hierarchy.


Just to keep beating the dead horse, Source Code Control is the tool to avoid this happening to you. GIT is the most commonly used SCC out there, followed by SVN.

 

With that said, first thing you do is get your code into an SCC. Initially, this is a backup just in case you completely mess something up. After that, I would say creating a source distribution is the next thing to do, with just your top VI(s) explicitly called out. After "building" that, you should have only what is required. Test it to verify it still works. Finally, commit your updates to your SCC repository.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 9
(90 Views)

@RTSLVU wrote:

What is the most efficient way to clean this project...


My tongue-in-cheek response: Ctrl+A, Delete, Ctrl+S


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 9
(82 Views)

@crossrulz wrote:

@RTSLVU wrote:

What is the most efficient way to clean this project...


My tongue-in-cheek response: Ctrl+A, Delete, Ctrl+S


I guess what you mean is doing Ctrl+A and Delete from the file explorer, then "Save All (this Project)" from LabVIEW?

I don't think LabVIEW will like that, there will be lots of "[Warning: has been deleted, renamed or moved on disk]".

 

What about right-clicking your project root > Find Items with No Callers ?

You can even export its output to a text file and input it to a script that would delete them by path.

Make sure to remove/filter the VI paths that you don't want to delete though, as it will contain the top-level VI(s) as well.

 

Regards,

Raphaël.

0 Kudos
Message 6 of 9
(67 Views)

One thing I've found helpful is to open your project and then drag the "source" folder for the project from the windows explorer into your project. A lot of virtual folders may be created but LabVIEW will only add files if they aren't already in the project. This is an easy way to find orphaned VIs without any additional tooling.

0 Kudos
Message 7 of 9
(57 Views)

@RTSLVU wrote:

I have several years worth of older vi versions in my project hierarchy.


@Jacobson wrote:

One thing I've found helpful is to open your project and then drag the "source" folder for the project from the windows explorer into your project. A lot of virtual folders may be created but LabVIEW will only add files if they aren't already in the project. This is an easy way to find orphaned VIs without any additional tooling.


I may have interpreted wrong, but it seems @RTSLVU is talking about uncalled VIs already in the project.

0 Kudos
Message 8 of 9
(51 Views)

@Kyle97330 wrote:

(If you don't have source control, start using it!)


@crossrulz wrote:


Just to keep beating the dead horse, Source Code Control is the tool to avoid this happening to you. 

 

Speaking of beating a dead horse. I have been asking for access to our source control for over a decade. Those snooty software and firmware group managers don't believe my work is important enough to be allowed to use their precious tools. 

 

When I leave this company they could be screwed.

I have long since come to the conclusion that if management doesn't care, why should I?

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 9 of 9
(24 Views)