News

Using Perforce with LabVIEW - Page 6

So what are Versions, Source Control, and Configuration Management?

Let's say you had some LabVIEW code that runs on Pocket PC, but not on PalmOS. Most of the sub VIs run, but some key elements, typically user interface customizations, or in the case of a customer, product configuration tweaks cause defects at many levels in the system.

Many LabVIEW programmers will simply take a shortcut and start saving different names of VIs. Eventually, this becomes a mess. LabVIEW is pretty good about prompting for issues like finding same-named VIs in memory, or even finding things where they weren't expected. Nonetheless, typical users just click through prompts and eventually shoot themselves in the foot by saving things they wish they hadn't, or by not being able to find a specific piece of code.

Versioning, Source Control and Configuration Management aim to resolve these common types of development issues. In larger projects with multiple developers this can become quite complex. Add issues like forking and branching, and re-assigning developers to multiple projects and the scope widens.

The example for this article is to do a simple Revision for one developer. Although Perforce is capable of far more complex operations (like those mentioned above), this example wil use the "Label" feature of Perforce. No forking, No branching, No multiple developers. Simply labeling a collection of source code revisions to create a "Version" (i.e. Product_1.12.34)

  • Checkin Your Code
  1. In the LabVIEW Project Explorer, right click and checkin your checked-out code
  2. You can also chech it in directly in Perforce, but you will need to close and reopen your LabVIEW project
  • Label the revision(s) you wish to associate
  1. Usually, you'll want to label the latest revision of the files in the collection, but you can specify other revisions.
  2. In Perforce, select all of the checked in Files with a Shift+Left Mouse Click
  3. Right click all of the selected files and choose "Label"
  4. A good Label would be "Customer_Product_MajorVersion.Minor.Micro" (i.e. Tradewerx_Clairvoyance_2.0.15)

You now have the ability to get the revision (In Perforce, not LabVIEW) of all of the files associated with a particular Version (or "Label" in Perforce parlance). Simply right click a file or group of files, and get the revision based on "Label" rather than revision. You shoud probably exit LabVIEW when doing this operation, and you should make sure all code is checked in prior to checking out older revisions.

John Giannangeli is a Founder
and Principal Engineer at Giawerx