From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Project "Save As" created undesired file hierarchy

Solved!
Go to solution

I created a project that was fully functional, but needed to clean up the file structure since it is part of a preexisting format established here at work. I attempted to "Save As" a backup in case the inevitable operator error occurred during this process. 

 

I made the mistake of checking "Include all dependencies" and ended up with this mess. When I attempted to modify the original project that I just "backed up" it tells me  failed to load DLL, dependencies etc.. so it is broken and i need to restore my backup to the desired location, along with all dependencies before I clean up the mess seen here. It seems there should be a MUCH easier way than my efforts thus far. I am almost positive I cannot just delete those files and try again.

 

 

One should welcome adversity as an opportunity to excel.
0 Kudos
Message 1 of 9
(2,476 Views)
Solution
Accepted by topic author Daddy-O

You sound like someone with "more than a beginner's knowledge and experience using LabVIEW" (you know about Projects, for example).  You also appear to be doing serious development work "at work".  Here are some suggestions "going forward" --

  • LabVIEW development is more less stressful when coupled with some form of Version Control System.  I've used Tortoise Subversion (with one or more Subversion Servers maintained by my employer or by an outside vendor), and would not dream of doing any serious (i.e. "more than three VIs in a Project") development without creating a Repository for the Project.  As Fabiola says, this creates a "Time Machine" for you that lets you go back and get that version from last week that worked, before you started to "improve" it.
  • I almost never use the File view of Project Explorer.  Almost every time I try, I regret it and have to "repair" my Project.
  • When things really get messed up, but I think the Files and Folders in the Project are "mostly OK", what sometimes works (after ensuring that I've got things committed to Subversion) is to delete the Project file, create a New Project, then Add Folders (and individual VIs) in an attempt to "undo the mess I've made".  This has worked more times than I'd care to admit (I do sometimes make really silly mistakes ...).
  • Look through your Project entries.  If something shows as missing, ask "Should this be in the Project?".  If No, then delete it.  If Yes, ask where is it, and bring it into the Project.
  • Your milage will probably vary, but I find that I make fewer mistakes when (a) my Project folders in Project Explorer match the Project's Folders in File Explorer, (b) (almost) every file in the "Project on disk" is in the Project (I often leave "Documentation" and "Obsolete" out of the Project -- the latter is a "crutch" where I put "bad ideas" or "first attempts" that I want to keep for a while).  [If you've been reading carefully, you'll know I should just delete the Obsolete files/folder -- if I need any old stuff back, I can just get them from Subversion).
  • Resolve Conflicts, saving as you go.  You may get to a point where you find they don't resolve -- the next step should fix some of this.
  • Look in Dependencies.  Try to fix errors you see flagged there.  Something may be in Dependencies because it is called from somewhere in the Project, but can't be found.  If you know where it is, specify it.  If it belongs in the Project, put it there by using "Add to Project".  Again, I'd recommend first copying the file to a folder in the Project and then doing the "Add" from that internal folder.
  • A note of caution -- my preference for having all files in the Project folder can mean that a "Utility" file used in Project A and Project B might be slightly different.  What I should be doing is creating a User Library that I can install via a Package Manager, but I haven't quite gotten there, yet.

Bob Schor

Message 2 of 9
(2,438 Views)

There are three options that could have been pursued:

  • Copy the folder containing the project to another folder.
  • Use versioning software (SVN with the Tortoise shell is my favorite - YMMV)
  • Save as...

Save as... would be my last choice; TSVN my first.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 9
(2,428 Views)

@Bob_Schor wrote:

...

  • Look in Dependencies.  Try to fix errors you see flagged there.  Something may be in Dependencies because it is called from somewhere in the Project, but can't be found.  If you know where it is, specify it.  If it belongs in the Project, put it there by using "Add to Project".  Again, I'd recommend first copying the file to a folder in the Project and then doing the "Add" from that internal folder.
  • A note of caution -- my preference for having all files in the Project folder can mean that a "Utility" file used in Project A and Project B might be slightly different.  What I should be doing is creating a User Library that I can install via a Package Manager, but I haven't quite gotten there, yet.

Bob Schor


Everything in the project works OK if we just have one application.

 

But when you get to the point where you are writing more than one application (as in AN app for Windows and an app for cRIO) and we have to maintain backward compatablity... then  separate projects just for shared data structure works nicely and let us avoid the SVN battles that happen when more than one developer is making changes.

 

After all the libraries we use from NI do not show up in the project and they work just fine.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 9
(2,427 Views)

Thank you for the thoughtful reply. In hindsight, I have decided that I definitely should work in a project, as opposed to transforming it at the end. We have Tortoise available here. I will have that installed before proceeding. I feel silly, because the code works as intended, looks good, is efficient and scale-able. I just did not take the necessary precautions to prevent this. I save my VI's every day with a date to (I thought) prevent this from happening. I will take your advice, step by step and make it right. I was hoping there was a magical "undo" button out there. Apparently it is Tortoise, and a little planning ahead. Thank you again for taking the time to look at my problem. Have a great day.

One should welcome adversity as an opportunity to excel.
0 Kudos
Message 5 of 9
(2,424 Views)

Thanks! I will learn from this experience. I appreciate the guidance.

One should welcome adversity as an opportunity to excel.
0 Kudos
Message 6 of 9
(2,420 Views)

@Daddy-O wrote:

Thanks! I will learn from this experience. I appreciate the guidance.


I have told my noobs after they lost code and have to rewrite it...

 

"the good thing about rewriting code is you will do a better job the second time."

 

Ben

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

A friend of mine says, "The best sense is bought sense".

One should welcome adversity as an opportunity to excel.
Message 8 of 9
(2,413 Views)

I almost shouldnt say it but the Windows feature "Previous versions" has saved me a couple of times when I was over-eager in deleting files I hadn't committed to TSVN yet.

 

Just sayin'

0 Kudos
Message 9 of 9
(2,400 Views)