LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changes made to a particular project's VI seems to reflect in other project VI holding the same name

Solved!
Go to solution

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.

yYvxaJy

NI System Configuration:
- NI PXIe-1071, 4-Slot 3U PXI Express Chassis , 1 GB/Slot throughput, Part Number: 781368-01
- NI PXIe-PCIe8381,x8 Gen2 MXI-Express for PXI Express Interface,3m, Part Number: 782522-01
- PXIe-5160 PXI Oscilloscope, 500 MHz, 10 bits, 2.5 GS/s, 2 Channels, 64 MB, Part Number: 782621-01
- Astronics PXIe-1209 2-Channel, 100 MHz PXI Pulse Generator, Part Number: 785033-01
0 Kudos
Message 1 of 10
(3,013 Views)

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.

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 2 of 10
(3,007 Views)

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.

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 10
(3,004 Views)

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.

 

 

0 Kudos
Message 4 of 10
(2,992 Views)

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

Message 5 of 10
(2,972 Views)

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 Smiley Surprised


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 10
(2,962 Views)

Whenever I want to make a big change to a project and start off as a new project; I do the following:

  1. Save and close all VIs currently open except the project explorer window (assume that the project has only Main.vi for now)
  2. File - Save As - Copy (create an unopened copy of the .lvproj file on disk)
  3. Close the project explorer window
  4. 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?

 

NI System Configuration:
- NI PXIe-1071, 4-Slot 3U PXI Express Chassis , 1 GB/Slot throughput, Part Number: 781368-01
- NI PXIe-PCIe8381,x8 Gen2 MXI-Express for PXI Express Interface,3m, Part Number: 782522-01
- PXIe-5160 PXI Oscilloscope, 500 MHz, 10 bits, 2.5 GS/s, 2 Channels, 64 MB, Part Number: 782621-01
- Astronics PXIe-1209 2-Channel, 100 MHz PXI Pulse Generator, Part Number: 785033-01
0 Kudos
Message 7 of 10
(2,930 Views)
You are absolutely right. I checked the item paths and the lvproj file seems to show the path where I expect it to be, whereas the Main.vi is showing a totally different one altogether.
NI System Configuration:
- NI PXIe-1071, 4-Slot 3U PXI Express Chassis , 1 GB/Slot throughput, Part Number: 781368-01
- NI PXIe-PCIe8381,x8 Gen2 MXI-Express for PXI Express Interface,3m, Part Number: 782522-01
- PXIe-5160 PXI Oscilloscope, 500 MHz, 10 bits, 2.5 GS/s, 2 Channels, 64 MB, Part Number: 782621-01
- Astronics PXIe-1209 2-Channel, 100 MHz PXI Pulse Generator, Part Number: 785033-01
0 Kudos
Message 8 of 10
(2,927 Views)
I do use Tortoise SVN. Whenever I rolled back I see the changes in all of the projects so I thought it has something to do with SVN then it didn't make sense because I've never seen this happen with Python, MATLAB or Mathematica projects at all. So I was sure I was doing something wrong w/ respect to LabVIEW style of programming and maintaining code.
NI System Configuration:
- NI PXIe-1071, 4-Slot 3U PXI Express Chassis , 1 GB/Slot throughput, Part Number: 781368-01
- NI PXIe-PCIe8381,x8 Gen2 MXI-Express for PXI Express Interface,3m, Part Number: 782522-01
- PXIe-5160 PXI Oscilloscope, 500 MHz, 10 bits, 2.5 GS/s, 2 Channels, 64 MB, Part Number: 782621-01
- Astronics PXIe-1209 2-Channel, 100 MHz PXI Pulse Generator, Part Number: 785033-01
0 Kudos
Message 9 of 10
(2,927 Views)
Solution
Accepted by topic author asukumari

@asukumari wrote:

Whenever I want to make a big change to a project and start off as a new project; I do the following:

  1. Save and close all VIs currently open except the project explorer window (assume that the project has only Main.vi for now)
  2. File - Save As - Copy (create an unopened copy of the .lvproj file on disk)
  3. Close the project explorer window
  4. 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).

0 Kudos
Message 10 of 10
(2,920 Views)