LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"substitute copy for original" and its consequences

When I want to save one of the VIs in my project, I often choose "save as", so that the currently working version isn't written over in a subsequent save.  I then choose the option "copy/substitute copy for original".  (I don't know why I would even select one of the other options).  When I choose this option, it gives a warning that I don't understand, partly because of ambiguous grammar:

 

"Updates all referencing files in the project and its dependencies to refer to the copy"

 

What does this sentence mean?

 

Then, when I press "continue", I get another box saying that several files are closing and they have unsaved changes (see attached png file).  However, I didn't even open these files, let alone change them.  Sometimes, VIs that I didn't even write (OpenG VIs) are included in the list.

 

What does all this mean?

 

Thanks.

Download All
0 Kudos
Message 1 of 9
(3,356 Views)

When you substitute the copy for the original then LabVIEW has to update all of the vi's so that they reference your new name instead of the old name. This is why the other files have to be resaved. They are now linking to your new file name.

 

If you click on the help there is a very good description of this and why you would select the other options. I don't want to copy and paste the help and I don't want to attempt to do a better job of documenting the options.

 

As far as the OpenG stuff I think this is because you are saving them in a newer version of LabVIEW. That is only a guess so take it for what it is worth.

=====================
LabVIEW 2012


0 Kudos
Message 2 of 9
(3,351 Views)

You have subVI A.vi.  You do a replace copy for original and name it B.VI.  Now wherever A.vi was used, it will now point to the new B.vi.  Thus a change to that file.  If there are subVI's of other names that also refer to A.vi, they are now updated to refer to B.vi.  The reason it is asking for you to save the changes of other files right away, it is because they are closed, but in memory.  The memory has been updated, but the changes in them need to be saved to file.

 

Click on the link to List Unsaved Changes to see the details of what has changed.

0 Kudos
Message 3 of 9
(3,350 Views)

The wording in the help (which I should have checked before) is somewhat different and clearer than the dialog box:

"Caution  If the original file has calling VIs in memory, this option updates all these callers to refer to the new file."

 

This wording and your explanations are what I initially suspected, but it doesn't seem consistent with the VIs listed in the 2nd dialog box "save changes before closing".  Only the first VI (bias map) is a calling VI.  The other 3 VIs are neither calling VIs nor sub-VIs, so I wouldn't expect them to appear in that list.  The OpenG file of course isn't a calling VI either (it doesn't appear here, but it has appeared in the past "save as" attempts).

 

Next time it happens, I will look more carefully at the link to List Unsaved Changes to see if I can understand what's going on.

 

 

0 Kudos
Message 4 of 9
(3,336 Views)

It's getting murkier...

it did happen again while saving another VI, and this time, I asked it to list the unsaved changes.  Oddly, it showed changes that were made several days ago that must have been saved, because Labview was shut down multiple times in between.  Furthermore, the changes listed didn't include anything about their connection to the VI I was presently attempting to save.

0 Kudos
Message 5 of 9
(3,332 Views)

I think that it is asking you to save the OpenG stuff because it was converted from an older version.

=====================
LabVIEW 2012


0 Kudos
Message 6 of 9
(3,304 Views)

Please note which VI's you were doing the "save as" on when the OpenG VI's want changed. Most of Open G stuff is built-on stuff that ships with LV. If you are getting that message you may be stepping on stuff in VI.lib.

 

Ben

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

Ben,

What do you mean "stepping on stuff in VI.lb"?  Do you mean somehow modifying those files?  How would I know this, and how would I prevent it?

Thanks.

0 Kudos
Message 8 of 9
(3,238 Views)

If you did not write it...

 

STOP right after you do the Save As..." and take a good look at the drop-down that lets you navigate and figure out where that VI was to start. If it's in the NI folder, you should think twice becuae your next upgrade may step on any change you made.

 

You prevent it by not updating the caller and save the VI to where you want it (with a new name if it was an NI VI). THEN go back to your code and use "replace" and navigate to your newly saved unique VI.

 

Ben

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