LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there an "easy" way to change file location links in a project?

Solved!
Go to solution

I have a project in development on two machines- one 2020, and one 2023. The 2020 version is a slightly older version that I'm retaining as I'm using it with NI tech support to fix a bug, so I can't easily upgrade it to 2023 without changing way too many variables.

 

The 2023 version has a library in it I'd like to move to 2020. Ideally, I'd do a Source Distribution targeted to 2020- but Source Distributions don't have a "target version" option. When I do a "Save for Previous", it creates a TON of extra upstream linked files.

 

I can load this into 2020, but now I need to point all of those links to upstream linked files to my "actual development" 2020 versions.

 

For example, say my project has Car.lvclass inside Car.lvlib, a descendant of Vehicle.lvclass inside Vehicle.lvlib. I need Car.lvlib in my 2020 installation, so I do a Save for Previous, and it generates a new folder containing:

 

--Car Backsave 2020

----Car.lvlib

----Car.lvclass

----Vehicle.lvlib

----Vehicle.lvclass

 

Problem is, my 2020 version already has a Vehicle.lvclass with a bunch of descendant stuff in it, so I need my new Car.lvclass to link to \dev\Vehicle.lvclass, not to Car Backsave 2020\Vehicle.lvclass.

 

I can go in and delete "Car Backsave 2020\Vehicle.lvlib", then load Car.lvlib, and it'll say "Hey I can't find this class- where is it?" and I can point it to \dev\Vehicle.lvlib, and it will recompile everything, but that feels very "brute force" and I've had issues in the past with things getting screwed up when that happens.

 

Trying a right click -> Replace With gives me a warning since the old files and the new ones have the same name. Trying to rename the old ones and use "Replace with" also seems to cause everything to explode.

 

Is there a way to say "I want to use this file, not this file" other than deleting the old one and letting it prompt you?

 

(I should add, my real use case has around 20 classes/libraries/etc so it's a real nightmare to change linking one piece at a time, as then it'll start linking part of the old files and part of the new files.)

0 Kudos
Message 1 of 6
(417 Views)

Hi Bert,

 

What about simply copying your "Car" class from "Car Backsave 2020" to "dev", then open it from there?

If the relative path to the parent "Vehicle" did not change between 2023 and 2020, it should open without any problem.

 

Also, make sure your sources are not under some special LabVIEW folder such as vi.lib, instr.lib, user.lib, etc... 

Otherwise dependency paths may not be saved as relative but rather as absolute (this is always a pain when copying something from these folders).

 

Regards,

Raphaël.

0 Kudos
Message 2 of 6
(389 Views)

That's kind of the issue... when you do a Save for Previous, it duplicates all of the "dependent" stuff to a new relative path, and relinks the downstream components to this new location. A Source Distribution or a PPL build lets you exclude things, but I can't find a way to do that with "Save for Previous".

0 Kudos
Message 3 of 6
(382 Views)
Solution
Accepted by topic author BertMcMahan

@BertMcMahan wrote:

That's kind of the issue... when you do a Save for Previous, it duplicates all of the "dependent" stuff to a new relative path [...]

Not to a new relative path, but to exactly the same relative path as your 2023 source. So unless you purposely modified your file structure between your 2020 and 2023 codes, there is no reason it wouldn't work.

 

Do a save for previous of your "Car" library to a temporary folder. Then cut the backsaved "Car" library and paste it where it would have been if you developed it from your 2020 project (so that the existing "Vehicle" is at the same path relatively to the pasted "Car").

 

Otherwise, there is something more complicated about your folder structure that you need to explain. What is the folder structure of the 2020 code, of the 2023 code and of the "saved for previous" code?

 

Message 4 of 6
(362 Views)

This saves the VI only.

paul_a_cardinale_0-1712031399705.png

Now all you need to do is write code that gets references to all your files.

Message 5 of 6
(345 Views)

@raphschru wrote:

@BertMcMahan wrote:

That's kind of the issue... when you do a Save for Previous, it duplicates all of the "dependent" stuff to a new relative path [...]

Not to a new relative path, but to exactly the same relative path as your 2023 source. So unless you purposely modified your file structure between your 2020 and 2023 codes, there is no reason it wouldn't work.

 

Do a save for previous of your "Car" library to a temporary folder. Then cut the backsaved "Car" library and paste it where it would have been if you developed it from your 2020 project (so that the existing "Vehicle" is at the same path relatively to the pasted "Car").

 

Otherwise, there is something more complicated about your folder structure that you need to explain. What is the folder structure of the 2020 code, of the 2023 code and of the "saved for previous" code?

 


Ah, I didn't realize it was guaranteed to maintain all relative paths. That will (probably) make a massive difference then! In retrospect it makes sense it would maintain that pathing but I didn't know it was guaranteed to do so. I'll try some experiments and see.

0 Kudos
Message 6 of 6
(306 Views)