LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to copy VI and create new subVI paths

Solved!
Go to solution

Hi all,

 

I'm still pretty new to LabView, and I'm not sure how to properly do this..

 

Basically I have a working VI which validates a chassis, but I want to use the code on another chassis. The only differences (that I know of) are the login name and password for the new chassis. I enter these two fields using string constants in a subVI.

 

If I simply copy the directory of the VI and all the subVIs to a new directory, and open one of the new .VIs, any of my changes are updated to the original VI. How do I break the links to the 'old' files?

I want to have separate directories for chassis "A" and chassis "B" with all the necessary VIs and subVIs in each, even if the files are redundant on the hard drive (in case the VIs or subVIs need minute changes).

 

Sorry for the vagueness in the subject, by the way.

0 Kudos
Message 1 of 7
(5,422 Views)

Hi EDS;

 

save hierarchy to new location...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(5,418 Views)

GerdW,

 

I just gave this a few tries - I keep getting a message box window saying 'LabVIEW: Generic file I/O error.' And only some of the files are in the new folder.

0 Kudos
Message 3 of 7
(5,414 Views)
Solution
Accepted by topic author CelerityEDS

Are you using projects?

 

Copy the code to your new location.  Create a project and add the folder that contains your code.  Use the conflict resolver to fix your VIs.

 

In some weird situations, I have also been known to delete the old project, resolve the conflicts for the new project, and then restore the old project from the recycling bin.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 7
(5,406 Views)

I opened up my main VI, created a new project which included my current open VI, saved, then copied the directory. Renamed the project and all the paths look like they use the new directory.

I didn't run into any conflicts to resolve - should I have?

 

Thanks for the help guys.

0 Kudos
Message 5 of 7
(5,396 Views)

You shouldn't necessarily have conflicts.  But if you did, the project helps to clean them up.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 7
(5,390 Views)

No.  You shouldn't have had problems.  But you also shouldn't have had the problems you first said you were having.

 

Generally problems with cross-linked files are going to occur if you have subVI's that are in another location independent of your first project folder.  When you create a new project folder, it may still have subVI's pointing to the original location.  But if that was the case, you would possibly be still having problems.

 

The other issue might be if you try to open your second project (without using project a project file) while the first project is still open.  You can only have one file open of a given name at a time unless you have them open in different project instances (which won't be the case if you are not using the project hierarchy.)  Then the 2nd projects VI's will get cross-linked to the first because they were the ones in memory at the time you opened the 2nd project.  This certainly could be the cause of your original problem.  But you'll generally have a hint it is occurring because you'll have dialog boxes that tell you a file is already open and the one in memory is being used.

0 Kudos
Message 7 of 7
(5,388 Views)