LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting up Subversion/PushOK and Projects

I've been "carefully" developing a fairly large project using Labview 8.5 Project to manage my modules.  I had been using "poor-man Version control", putting each day's work in a separate folder called "Work 13Feb08", "Work 14Feb08" etc.  I've just been "educated" in using Subversion to manage the various versions for me, and it looks pretty handy.

I'm a bit hazy on how it integrates (or if it should integrate) into LabView.  I have installed PushOK, but have not done the Source Control Option setup in Project Explorer.  I am using the Tortoise "shell" for Subversion, and have been checking out and committing changes directly in Windows Explorer.

Looking at the Forums, I'm still a little confused whether this is the recommended way to do this, or whether I should (and how I should) configure Source Control in Project.  I'm assuming that if I do this, Project will "manage" the updates for me, but that is also not clear.

It would be a great help if someone who has used Project, Subversion (particularly the Tortoise shell -- I didn't get the reason for the name "Tortoise" until I wrote this post), and PushOK made some suggestions on "Best Practices", or the Pros and Cons of configuring Source Control from within Project.  If this is posted somewhere (but I couldn't find it ...), a pointer would be also helpful.

Bob Schor
0 Kudos
Message 1 of 17
(8,868 Views)
I cannot comment on PushOK (other than firefox 3 beta 3 seems to think the www.pushok.com is a phishing site!), but I use SVN (specifically Tortoise SVN integrated into the Windows Explorer) and it works great. I do not bother with the source code control in LabVIEW itself, I use SVN to manage the whole project directory including non VIs such as screenshots, user manuals etc etc.


Message 2 of 17
(8,856 Views)
I'm using the PushOK plugin from within LabVIEW and works OK.
It's not usable for anything fancy, or writing your own SCC code in LV since all actions are accompanied by a dialog.
But for check-in/out it works OK

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 3 of 17
(8,830 Views)
 

Hi Bob,

Using Source Code Control (SCC), you will be able to keep track of revisions of the program. All changes are documented so that you can have a clear track of the program evolution and previous versions are saved by the tool.

 LabVIEW supports various thrid party source code control providers. Among them are

  • Microsoft Visual SourceSafe
  • Microsoft Team System
  • Perforce
  • Rational ClearCase
  • PCVS (Serena) Version Manager
  • MKS Source Integrity
  • PushOK CVS
  • PushOK SVN
  • Seapine Surround SCM
  • Borland StarTeam
  • Telelogic Synergy
  • ionForge Evolution

Here is a link on configuring your labview for SCC.

I hope this answers your questions!



 
Warm regards,
Karunya R
National Instruments
Applications Engineer
Message 4 of 17
(8,817 Views)

Hi Bob,

I am just about to go down the same source code control route as you described on your original post.  I have downloaded TortoiseSVN and would like to use it with LV8.5 project manager.

Did you continue down this route or choose a different 3rd party SCC applciation? (E.g. Perforce)

Did you come to any conclusions on the best method?

Did you use TortoiseSVN standalone or did you use it with LV Project manager? Did you have any issues?

Do you have to install PushOK or anyother applications to get it to work?

Any tips and tricks would be appreciated.

Cheers

Ian

0 Kudos
Message 5 of 17
(8,389 Views)
Ian,
     I'm a Happy Subversive LabVIEW Programmer (pun definitely intended).  I'm also using Project with LabVIEW 8.5, and am using Subversion (but NOT PushOK) to manage it.  I will note that I initially did install PushOK, but perhaps because I "don't get it" (and am new to Version Control), it drove me crazy and I decided to "try without it" (and am very pleased with the results).

     Having now built a few projects under Subversion, here are What Works For Me (your situation might differ).  First, my LabVIEW "projects" tend to actually be separate projects, so I tend to organize them as separate "items" in Subversion.  Say I have projects named ProjOne, ProjTwo, and ProjThree.  In my Subversion repository, I'll have three "top-level" folders called ProjOne, ProjTwo, and ProjThree, each of which has three folders called trunk, branches and tags.  My "working copy" (the folder on my PC where I do all of the LabVIEW development) will essentially come from the contents of the corresponding "trunk" folder.

     Assuming I'm starting a new project (call it ProjFour), I would do the following:
1) Create a top-level folder for my project, to become the Working Copy.  Call this folder ProjFour.
2) Create a Project (also called ProjFour) and save it inside this folder.
3) Create the VIs, libraries, etc. that you will need in your project, organizing it as you find most effective.  In my case, I'm at an early enough stage that most of the VIs from my various projects are completely independent of each other, hence I keep all of the project's VIs and other files together inside the "project" folder (ProjFour, in this example).  I've found it convenient to create subfolders, both "real" subfolders and "virtual" subfolders in Project, to keep the VIs organized.  Thus I have folders called Util, File, Tests, Templates, Types (my term for controls, typedefs and enums), etc.  Essentially the only files in the ProjFour folder that is not in a subfolder will be the ProjFour.lvproj and ProfFour.aliases files.
4) Create, in Subversion, a ProjFour folder, with trunk, branches, and tags subfolders.  Check in your initial Working Copy to the trunk.

     You now have a Subversion repository of your project, as it exists at "time of creation".  Go ahead and modify, update, replace, reorganize, etc. your code.  At regular intervals (for me, this is typically after I've done a day's work, especially if there's a chance I'll want to "continue from home" to work on the same thing), commit your changes.  I strongly recommend that you turn on the option in Subversion that requires that you post a Commit Log message (I think I made my minimum be 40 characters), as this forms a sort of "auto-documentation" of the changes.

     Every time you start work, particularly if there are multiple people working on the code (or you are working on it from multiple PCs), update your working copy to be sure to get the latest changes.  As your code reaches "stability" (don't we wish!), you can "tag" it to signify a stable release.  So far, I haven't used branches very much, and when I've tried, I've mostly confused myself!

     I really like the "comfort" in having a known "backup" of the code, complete with annotations, particularly for developing using multiple machines (and sites, like Office, Lab, and Home), that Subversion provides.  Formerly, I would create folders called ProjOne01Apr08, ProjOne03Apr08, ProjOne07Apr08, each of which would be the current day's Working Copy, and carry it around on a USB stick.  However, there was no easy way to tell what changed from day to day, nor a convenient way to "mark" a version as "relatively stable" to use as a divergence point for trying a new development idea.  Subversion gives you all of this, particularly if you commit your changes at "intelligent" breakpoints in the code development (and, of course, document the version in the Commit log).

     It is possible, even with only one person using the Repository, for files to get "out of synch".  Not to worry, Subversion has some really loud and unusual alarm sounds that unmistakably alert you when there is a problem or confusion!  These were generally quite easy to resolve, though you may need to utilize LabVIEW's Compare VI tool (remember to rename at least one VI) to help you decide which is the "right" version to keep.

     Good luck.  I hope you'll be as pleased with Subversion as I am.  Should you find any useful tricks (or should you decide that PushOK really does offer great things that I've been missing), please reply.

Bob Schor
Message 6 of 17
(8,369 Views)

Subversion is a great version control system, I've been using it for about 1 1/2 yr.  It works well with LV since it handles binary files internally, which means that the repository does not need to store a unique copy of each file committed.  Instead, it only stores the difference between the previous and the current version so that disk space is economized on the server. Also it is possible to branch a project without it taking up twice the space on the server (as with the older CVS) -- which is implemented as a "cheap copy" in Subversion.

 

The only thing I'm missing is the ability to do a "diff" between two revisions. It seems the "diff" program in LV only allows comparing two files within the same project (it's available from the menu inside LV, Tools->Compare->Compare VIs...).  Nor is it possible to call the program externally (e.g. "lvdiff.exe file1 file2 " ) .  Anyone found a solution to this? I imagine if one integrates a fully supported version control system with LV it may be possible?? Does this work if you use Perforce?  *** Would be really nice if NI would add this as a feature. *** Smiley Happy

Message Edited by robdevyogi on 08-22-2008 01:56 PM
Rob
0 Kudos
Message 7 of 17
(8,215 Views)

Rob,

     There's the usual "Good News, Bad News" mix in the VI Compare utility.  First, both VIs do not need to be in the same project (though it works much better if they are, see below).  Instead, both must be in memory at the same time.

     If you are working on a project that contains VIOne, and you want to compare it to VITwo that is not in your project, first open your project and VIOne.  Now open (Ctrl-O) VITwo, an action that will appear to load it into the project, but only does so if you save it!  Now do the Compare -- you'll see VITwo supposedly in your project, but again, if you don't save it, it will not be added.

     A trickier issue is comparing two versions of the same VI (obviously stored on different places on disk).  The answer here is to rename one temporarily.  Suppose you want to compare VIOne with an older version -- rename the older version VIOneOld, load it, and do the compare.  Don't forget to rename it back ...

     I recently had the opportunity to ask NI developers about including a "Compare to disk copy" extension of the Compare tool.  Someone mentioned that OpenG (or maybe LAVA?) had such a tool, but I haven't (yet) found it.  If NI were to develop this, one method they could use is to automatically create a temporary "in-memory" name for the VI pulled up from disk, just for the purposes of guaranteeing unique in-memory names for their existing tool.  Maybe this is something we might see in LabVIEW 8.7?

 

Bob Schor

Message 8 of 17
(8,193 Views)

Hi there

 

TortoiseSVN is OK with LabVIEW, as long as you don't make a Mass Compile. SVN creates hidden files named similar to the versioned files. LabVIEW touches each file named "*.vi*", "*.ctl" and so on recursively in the selected folder to mass compile. This will crush your local SVN working directory.

 

I suggest  to use TortoiseCVS. Usage is similar to TortoiseSVN, but it uses CVS instead, which dosn't create such files. Can be found here

 

http://sourceforge.net/projects/tortoisecvs/

 

Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
Message 9 of 17
(8,175 Views)

Hi Bob,

 

There is such a tool and it's called lvdiff.  The version I tried some time ago was not compatible with current version of LV. See: http://sourceforge.net/project/shownotes.php?group_id=29668&release_id=409179

 

Here is another thread discussing comparisons of files: http://sourceforge.net/project/shownotes.php?group_id=29668&release_id=409179

 

Still, looks like the optimal solution to diff'ing two revisions of the same file would be if that was incorporated in to LV itself in the future... http://digital.ni.com/public.nsf/allkb/EDA7C01C684ACB6286256FF0000238D5?OpenDocument 

 

 

 

 

Rob
0 Kudos
Message 10 of 17
(8,151 Views)