FIRST Tech Challenge Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Team programming and shared libraries

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.

0 Kudos
Message 1 of 4
(6,227 Views)

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.

Kevin Fort
Principal Software Engineer
NI
0 Kudos
Message 2 of 4
(2,976 Views)

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:

  • Since this is a VI that is referenced by multiple projects, any changes made to it will also be reflected in all other projects that call this VI (in many cases this is desired behavior, but it would be good to make sure the kids know the full impact of what they are doing)
  • Your Robot project is no longer stand alone. Whereas you used to use the Share button to create a single zip file that you could email to your colleague, you now need to separately distribute any subVIs and make sure that your colleague copies these into the same relative location on his computer. (This is why I recommended using the user.vi folder in step 2 above. If you use Documents or Desktop or any other aliased location that resolves your user name in the actual path, LabVIEW will have a hard time finding these VIs. Remember that "Documents" actually resolves to c:\users\<username>\Documents and unless your colleague has the same user name as you, there will be a path problem.)

I hope this helps. Happy roboting!

Tony Iglesias

Connally High School Robotics

0 Kudos
Message 3 of 4
(2,976 Views)

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

Team 4150 Mentor

0 Kudos
Message 4 of 4
(2,976 Views)