LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving a VI with it's subvis and hierarchy

Solved!
Go to solution

Hi Community,

 

I am working on two independent version of the same application. The differences are minor, most of the source code is the same. This is obviously a pain in the back to maintain as if I find a problem with versionA and fix it then I need to apply the same changes on versionB as well. Same if I want to add a new feature. Its especially painful if the fix affects several subVIs as then I need to copy the new version of these to the other version. Its very error prone as if I just forget to overwrite one VI then VersionB may not do what I expect it to do.

 

The question I have: is there a way to somehow export a VI with all of its subvis keeping the orignal folder structure so I can simply copy this new sturcture and it would overwrite all the old VIs?

 

(Before you ask... I have inherited this strucuture and there is absolutely no way to merge the two versions into one application. It must stay as is.)

 

Let me know if you have a feasible idea.

Thanks!

Message 1 of 17
(7,814 Views)

Hi 1984,

 

why don't you put both "versions" into just one LabVIEW project? You can have one set of common subVIs used by both MainVI versions. And you can have two AppBuilder settings in your project to still create two applications.

 

No need to copy from one "version" to the other! All in one place! Easy to keep your VIs in source code control!

Programming made easy… 😄

 

Before you ask... I have inherited this strucuture

And there is no way to get away from this legacy?

 

 

Best regards,
GerdW


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

As I have said I have inherited this setup and I must tell that I am very pissed off with it. With thats said I see no option to simplify my problem besides what I have asked in my question. Moving them into one project is not an option at this point. (and probably wont be in the future neither)

0 Kudos
Message 3 of 17
(7,805 Views)

Hi 1984,

 

even when you can't move collect all VIs in a project (you don't need to move them on your harddisc…), you can still put all common subVIs in just one folder. Then relink them in the MainVIs.

Or delete one set of your subVIs, then relink them for one MainVI so it uses the subVIs from the other MainVI.

 

I still don't get why you cannot delete one copy of those subVIs!

 

And I still don't get why you cannot change the file layout on your harddisc: When you are the programmer responsible for those projects it should be your duty to put them in your file layout as you need it…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 17
(7,781 Views)

I have to agree with GerdW here.  If you are keeping that much of the code the same, they should be looking at the same code.  You have yet to give a good reason why these projects cannot be merged.  But even if they cannot be directly merged, I would at the very least move all common code to a central place and have both projects point to that location.

 

I have dealt with this before and it is a major PITA.

 

Another option may be to use your SCC software.  You may be able to export changed VIs to another location with the hierarchy still in place.



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 5 of 17
(7,767 Views)
Solution
Accepted by topic author 1984

While it sounds like it would it be best to find a new way to manage these slightly different versions, I will answer your original question.

 

If all of your VIs are in a project, you can click File >> Save for Previous Version... And then choose the version you want to save it for. You can, of course, select the same version of LabVIEW from the dropdown menu (I wouldn't want you to change the version every save!). Pick a new folder to save to and it will preserve your file structure.

 

It could be a bit annoying because it copies the entire hierarchy. So if you have a folder called MyProject with subfolders, but MyProject is located in Libraries\Documents\LabVIEW Projects\2014\MyProject, then you have to dig several folders to get to your VIs.

Message 6 of 17
(7,734 Views)

Gregory,

 

     I may be wrong, but by "Versions" I don't think the Original Poster meant "Some of the code is in LabVIEW 2013, and some in LabVIEW 2014", but rather "Some of the code is Revision 4.3b and some is Revision 723", that is, different branches of a VCS tree.

 

     I have also dealt with the "multiple versions" nightmare.  Sometimes they were of my own doing, as I would carry around multiple versions of the code on USB sticks and on multiple machines.  Fortunately, about 6-7 years ago, someone showed me Tortoise Subversion and I started to use Version Control.

 

Bob Schor

Message 7 of 17
(7,705 Views)

Hi Bob,

 

I had that interpretation as well. I just wanted to point out that using the "Save for previous version..." option will re-create your entire folder hierarchy. It has come in handy a couple times when I wanted to zip up all of my project VIs and email them to someone.

Message 8 of 17
(7,696 Views)

This is exactly what I was looking for. Thanks Gregory.

0 Kudos
Message 9 of 17
(7,668 Views)

Hi,

 

one more possibility: Using the AppBuilder you can create "source code packets" (rough translation from German LV version) to create a folder with all needed files…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 10 of 17
(7,665 Views)