04-12-2019 03:01 PM
I have had this problem and did not take it seriously as I had backup copy of my projects. But I guess this is very critical and not to be taken light of, and is something I do not understand about LabVIEW.
My project is usually structured like shown below. I made changes to MAIN.vi on this project dated: 20190408. Did not like the changes so saved it (in case I need it for future) and opened up a previously dated 20190121 project which holds same structure as below with it's own MAIN.vi.
The MAIN.vi on the older project also seems to have the changes I made with the latest project. This was reflected in almost all other MAIN.vi files. Why does this happen? The changes I make to a project must be local to that particular project's ecosystem, and not leak outside.
Solved! Go to Solution.
04-12-2019 03:23 PM - edited 04-12-2019 03:27 PM
Not sure if I'm understanding you correctly, but the project file is essentially just a list of all the files it contains, and does not keep a "private" copy of the files for its own use; therefore, if a particular file is claimed by more than one project, since it is the same physical file, it will show up as changed in all of them.
I hope that answers your question.
04-12-2019 03:27 PM
I think I know what you are saying. Just remember my post above. You are changing the file, not the project, so even if you have an older version of the project file, you will have the current, changed, copy of the VI.
04-12-2019 03:37 PM
And if that does turn out to be your problem, one way of getting around it is to duplicate the project file contents, which can be found through the File -> Save As dialog. You can even choose to only duplicate your Main.vi along wit the project if that is all you are planning to change.
04-12-2019 10:22 PM
A Project looks like it has Files and Folders, but those Folders are "Virtual" Folders and do not necessarily exists on the disk. So it is entirely possible for multiple Projects to have Virtual Folders that point to the same Folder on disk, so any change to the File in Project 1 will affect all other Projects using the same physical (disk) folder.
Here's how you can check this: In the Project Explorer, go to the Project menu and choose "Show Item Paths". This will show you where the files in your Project actually live on disk. See if two of your Projects are, indeed, using the same disk file (which I suspect is the case) -- if so, this explains what you are seeing.
Bob Schor
04-13-2019 10:49 AM
Yes, always show item paths. Then remember to pay attention to them!
And, watch the context selector on the lower left of the diagrams...
Plus...you should have some source code control
04-16-2019 01:18 PM
Whenever I want to make a big change to a project and start off as a new project; I do the following:
Based on your explanation, it looks like the project environment and all files under it are not local to the project. It can also be from other projects. So what's the best way to make an exact copy of an already existing project and all files included with it for experimenting?
04-16-2019 01:22 PM
04-16-2019 01:24 PM
04-16-2019 01:49 PM
@asukumari wrote:
Whenever I want to make a big change to a project and start off as a new project; I do the following:
- Save and close all VIs currently open except the project explorer window (assume that the project has only Main.vi for now)
- File - Save As - Copy (create an unopened copy of the .lvproj file on disk)
- Close the project explorer window
- Browse to where I saved the project copy. Open the *.lvproj file. Open Main.vi and make changes
Based on your explanation, it looks like the project environment and all files under it are not local to the project. It can also be from other projects. So what's the best way to make an exact copy of an already existing project and all files included with it for experimenting?
Please re-read my post above. You just need to adjust your step 2 to:
"File > Save As > Duplicate .lvproj file and contents"
This will make a copy of all the files in the project instead of just copying the proj file (which as others have stated only maintains pointers to your vi files and does not keep its own copies).