12-11-2012 09:31 AM
In general, we create a new project for each iteration/version of our program. Perhaps that’s the wrong approach because it has created some problems for us. First, we’re finding it tricky to share vi’s across projects because LabView seems to like to associate vi’s with a particular project. Ideally, we’d like to create a library of free-standing reusable vi’s but haven’t figured out how. Second, we have trouble when two programmers work on copies of the same project. We’re not sure how to merge together each of our changes even when we work on separate vi’s.
I searched but didn’t find any information on team programming or shared libraries in LabView. Can anyone point me to any discussions, white papers, etc? If there aren’t any materials available, can anyone offer us advice?
Thanks in advance.
12-11-2012 10:44 AM
The FTC Robotics Project is actually a library not a normal LabVIEW Project. This makes it so that the VI knows it belongs to a library and the library knows what VI's belong to it. This makes it difficult to have multiple users working on the same VI's and difficult to use VI's between multiple projects.
For VI's that you are going to use in multiple projects you should create them outside of the Robot Project - just from the LabVIEW Getting Started Window itself. This will make VI's outside of the Project Library so LabVIEW won't check to make sure it is being used in the correct library.
12-11-2012 11:06 AM
I am glad you brought this up. I think it is an important topic and one that is not documented. My team struggles with it also. As it is a somewhat advanced case, a tool for managing libraries wasn't a "front and center" feature of LabVIEW for LEGO Mindstorms.
To my knowledge the best way to do this is to keep all of the VI's you want to share OUT of your robot project and ONLY call them as subVIs. So let's say I want a VI called sub.vi that I want to use across multiple projects. Here are the steps to do so:
1. Create this VI, but DO NOT create it with the New VI button in the Robot Project Center. Instead, close all Robot Projects and from the Getting Started screen Choose File>>New VI
2. Create the VI, and save is as sub.vi (or whatever you want to call it) to a known location on disk (I recommend you use the user.lib folder of your LabVIEW installation. (Usually c:\Program Files(x86)\National Instruments\LabVIEW 20xx\User.lib). Remember that you can only use this as a subVI, so be sure to create terminals for any inputs and outputs you want access to. When you save it, this is a "loose" VI and not associated with any project.
3. Now go into your Robot Project (or create a new one). DO NOT click Add VI to bring this VI into the project. Doing so will MAKE A COPY of this VI and put it in the project Iibrary. Instead, Create a new VI (either for NXT or Computer).
4. Go to the block diagram and from the palette, choose "Select a VI..." and browse to the known location on disk where sub.vi was saved. You now have access to that subVI that is outside of the robot project. This same subVI can be referenced by multiple projects.
A couple of things to keep in mind:
I hope this helps. Happy roboting!
Tony Iglesias
Connally High School Robotics
12-11-2012 11:09 AM
To address your issue about multiple people working on a project, Source Code Control (SCC or VCS) is the right way to go. A majority of LabVIEW programmers are using a free tool called SVN (Subversion). There are two pieces, a server to maintain the code database (or repository, repo) and the windows client.
This is a very hard subject to describe briefly but here I go: basically the Repo maintains a history of files and versions. When you are working on a VI you lock it meaning no one else can make changes then you commit your changes. Best practice is that you document the changes you made when you commit a file this makes looking back into history easier. If you work the process it helps things getting overwritten and/or lost.
VisualSVN Server (Server) http://www.visualsvn.com/server/
Tortoise (Free Windows Client) http://tortoisesvn.net/
Hope this helps.
-Steve