06-29-2015 03:27 AM
Hi,
I have some projects, which use some common VIs (like open/close file format and similar). What is the best practice to use these common VIs? Now I copy these to the project folders, but now I have multiple copies of some VIs, which is difficult to maintian, if I need to modify something in these common files.
What sould i use? Still copy, or link the common folder to my project, or use a packed project, or something else?
Thanks
06-29-2015 04:03 AM
What i'd do is have a Project folder with your specific project folders, and a Utility folder (or similar name) with the common VIs. That way it's easy to build up a reusable code library. In this Utility folder you can organize through subfolders, lvlib, llb's, classes and/or what else fits your style. 🙂
/Y
06-29-2015 04:04 AM
dont know if it is the best practice but with every new project, I create a new folder in my project (right click on my computer -> new -> virtual folder) and link that virtual folder to my folder that contains all my common code (vi/ctl/class) by right clicking on the newly created virtual folder and choosing "Convert to auto-populating folder".
One downside is that if you modify one of those vis for your new application, it might break it for one of your older projects.
I also use source code control (svn / git / mercurial / etc..) so if that happens, I can always go back to a previous working version.
06-29-2015 07:05 AM
What you realy want to do here is use VI Package Manager (VIPM). You create packages of your reuse code and you install the packages you want/need. The real beauty of doing it this way is they can also be added to your palettes. And if you go with the pro version of VIPM, you can create package configurations to add to your project to make sure you know exactly which version of what packages were used for that project.
06-29-2015 01:04 PM
thank you all for your suggestions
06-29-2015 02:48 PM - edited 06-29-2015 02:51 PM
VI's that I have made and reuse constantly are stored in C:\Program Files (x86)\National Instruments\LabVIEW 2014\user.lib (or a sub dir under it), that way all projects have access to them without having multiple copies is each project.