LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

upgrade labview project that has classes and subVi's

We have a  LabVIEW  project in LV 8.5( freated by a different developer) that has classes, and various Vi's , subVi's.

Screenshot_1.jpg

 

 

I am looking to upgrade it to LV 2014.  To be safe, I wanto to copy everthing into new classes( renamed from old ones), rename all the Vis( I hav ealready done that in Windows explorere, though not yet added them to project), and use them with renamed subVI's.

The old classes and VI's should remain in the same folder. 

 

What is best way to do that?

 

I found something here

 

https://lavag.org/topic/17741-the-nightmare-that-is-renaming-a-class-and-its-folder/

 

but this basically suggests many methods, and then, would delete the old structure.

 

Also, what happens to the "controls" that show up under "private" folder?

 

I have never worked with LV classes, so pardon any lack of knowledge.

 

sed_y

0 Kudos
Message 1 of 16
(3,718 Views)

If I were you, I'd give special attention to the post from Darren in that thread:

 

"My solution is to never, ever rename classes. I'm serious."

 

If you're going to embark on this, you've seen several experienced users on the lava forums discussing the various difficulties.  Be prepared for a long and frustrating process.  You'll need to ensure all references, including to controls, match your new file structure.

Message 2 of 16
(3,668 Views)

I would say that as long as you have your old project saved in source control or at least zipped up as a backup so you can restore it if everything goes wrong you should be OK.

 

I would copy the files to a new directory and then either open the project in LV2014 or mass-compile the directory to convert to LV2014.


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 3 of 16
(3,664 Views)

Thanks  for the advice.

  

I am planning to do following:

1) Copy everything to new subfolder(under current folder that has most of the Vi's and the classes and project) using Files view of the project, without renaming.

2) zip old files

3) use the copied project without changing any names( Labview should find these as if I enable seach directories, this would be a subdirctory under old folder?

4) All the subVI's that are being used and reside in different directories, will be made copy of into their own subdirectories, with the originals zipped.

 

However,I also see that many of the Vi's ( e,g in the attached snapshot, Read Configuration Files.vi) and subVI's in this project are using following folder:

 

C:\Program Files\National Instruments\LabVIEW 8.5\user.lib\General Use\ConfigUtilities

( Includes file like  Custom Read Keys.vi, Read Key+.vi etc).

 

Are these laBVIEW System Vi's? if yes, once the project is copied to subdirectory, would it be safe to use these VIs( once copy of these has been made as in step 4)

from within LabVIEW 2014, as path refers to LabVIEW 8.5? 

If not, should I copy these  to a specific  LV 2104  directory/folder?

 

thanks

 

sed_y

0 Kudos
Message 4 of 16
(3,655 Views)

4) All the subVI's that are being used and reside in different directories, will be made copy of into their own subdirectories, with the originals zipped.

 

That's the one you need to be careful of. If you have any shared code or re-use libraries outside of the project folder then these will get loaded and saved in LV2014. Use the 'files' tab of the project folder to see which files aren't in your project subdirectory.

 

Anything that is in user.lib you can copy from the 8.5 user.lib to the LV2014 user.lib folder and your project will automatically find them.

 

There are some useful tips here about working with LabVIEW projects and keeping all of your code in sensible locations. Anything relating to your project should be within the project subfolder and any shared code should go in the respective user.lib/vi.lib of the appropriate LabVIEW version - this does mean that you have a copy of the VI for each version of LabVIEW so you will need to be careful about making sure if you change it in one version you change it in the other. Even better still is to make your shared code into VI packages - then you can install them for any LabVIEW version and it will automatically save/compile them for the appropriate version. We used to have all of our re-use code in user.lib but it made moving between LabVIEW versions a pain so we started using VI packages and haven't looked back.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 5 of 16
(3,623 Views)

@sed_y2005 wrote:

 

C:\Program Files\National Instruments\LabVIEW 8.5\user.lib\General Use\ConfigUtilities

( Includes file like  Custom Read Keys.vi, Read Key+.vi etc).

 

Are these laBVIEW System Vi's? 


Generally, you'd expect the LabVIEW system VIs to be in vi.lib.  user.lib is where you'd add libraries you optionally selected to add to your installation.  These can be libraries you've made yourself or libraries you've acquired elsewhere.  I'd take a look into Sam's advice and modify the ConfigUtilities into a package.

 

I'd also stress working on a copy of your project rather than the project itself so you can always go back.  

0 Kudos
Message 6 of 16
(3,605 Views)

One comment and one question:

 

Before you touch a single line of code, set up Source Code Management. Subversion is a commonly used and free source code management tool. If you have never used a SCM tool before, you may want to make an additional copy in a zip file or similar. SCM's protect you when you are making changes. Upgrading LV versions is a perfect use case for this.

 

Second, why are you renaming anything? Why wouldn't you just open the code in 2014?

Message 7 of 16
(3,601 Views)

I was worried that if something breaks, I could just go back to old stuff.

0 Kudos
Message 8 of 16
(3,592 Views)

Fair enough.

 

This is what Subversion and other source code management tools are for. If you are going to develop code for a living, SCM is a must have tool in your toolbox.

0 Kudos
Message 9 of 16
(3,587 Views)

Do yourself a favour and don't rename any functions/classes. You'll just create confusion.

 

Easiest way is to just rename the project and the directory it sits in, so you end up with:

 

PROJECT_LV8_5 in directory PROJECT_LV8_5

and

PROJECT_2014 in directory 2014

 

Now just open PROJECT_2014 in LV2014 and you will probably find it runs like a charm. If not, you always have PROJECT_LV8_5 to refer back to.

0 Kudos
Message 10 of 16
(3,581 Views)