Wednesday, October 8, 2014

Three Use Cases for LabVIEW Bookmarks

When LabVIEW 2013 released, I was really excited about LabVIEW Bookmarks. I've been using them for a year now, and I feel they are one of the most productivity-enhancing features in the whole product.

What are bookmarks? Any word preceded by a "#" symbol within a free label, object label, wire label, or subdiagram label on the block diagram. So they're super-easy to create (you just type!), and also very easy to manage with the View > Bookmark Manager window. And my favorite (often-overlooked) aspect of the Bookmark Manager is that it will parse all of the VIs in your project for bookmarks, even VIs that are not in memory! In my opinion, that's the primary benefit that the Bookmark Manager provides over the standard Find window.

After using bookmarks regularly over the past year, I have discovered three distinct use cases where they come in handy:

To-Dos - This one is probably pretty obvious, but whenever there is a section of code that you know you'll need to revisit, stick a #todo bookmark there and use the Bookmark Manager to come back to it later.

Benchmarking - When I'm investigating a large app for performance improvements, I'll often make tweaks in several places to try to speed things up...turning on inlining, setting reentrancy, parallelizing For Loops, etc. I leave bookmarks (#inlined, #reentrant, etc.) where I make these changes to make it easy to come back to them later if necessary.

Code Review - I have a colleague with whom I've been doing frequent code reviews, and he's a Bookmark Believer too. It is so nice to arrive at his desk for a code review, and to see the Bookmark Manager already open on his screen, with #review bookmarks ready to go through, outlining all the changes he made.

So if you have LabVIEW 2013 or later, you should really start using this great feature! One final note...if you are using the Bookmark Manager to navigate through code that ships with LabVIEW, you might want to add these INI tokens to your LabVIEW INI file:

BookmarkManager.ShowVILIB=TRUE (LabVIEW 2013 and later)
BookmarkManager.ShowRESOURCE=TRUE (LabVIEW 2014 and later)

Without these INI tokens, the Bookmark Manager will not show bookmarks in VIs that live in the [LabVIEW 20xx]\vi.lib or [LabVIEW 20xx]\resource folders. Obviously I need these tokens for my work in LabVIEW R&D, but I can think of use cases where other LabVIEW developers might need to navigate bookmarks in shipping LabVIEW VIs as well.


2 comments:

  1. I'm the "Bookmark Believer" Darren mentioned. When bookmarks came out, I thought "meh." My conversion took about 5 minutes in that first code review. I'd like to add one use case to Darren's list, though it's kind of a subset of the Code Review use. If we're reviewing code that I've changed, I like to leave the bookmarks in place until just before I check the changes into source code control. Then I use them to document the change in the SCC commit and any related paperwork. That way, I'm not thrashing around at commit time trying to remember why that particular VI changed.

    ReplyDelete
  2. Thanks for publishing this. I wanted to be able to access the bookmarks for VIs installed in vi.lib via VIPM packages. This does the trick!

    Thanks,
    Fab

    ReplyDelete