I was prompted to write this post after hearing a LabVIEW presentation at a user group where the presenter made a throwaway comment “I don’t see the benefit of using bookmarks, I can find the code I’m looking for simply by a VIs filename”
I was tempted to jump in and add my thoughts right away, but two things stopped me:
- I’m British; It’s simply “Not Cricket” to interrupt a presentation in such a manner.
- A blog post on this subject would fit very nicely into a series I’d like to write on “Building your own CI System”…..I needed a kick in the ass so to speak.
Bookmarks have been around for several LabVIEW versions now, I want to say since 2014 / 2015 but I’m sure somebody can chime in with the exact version. That being said, my use of them was sporadic until I started to see some uses when linked to two tools I’ve been working on, but more on that later.
Generally speaking, a bookmark is something that lets you find useful information quickly; i.e a bookmark in an actual book (remember those?) or a bookmark in your internet browser of choice taking you to your favourite YouTube Channel.
So what is a bookmark in LabVIEW?
Put simply, a bookmark is a free text label with a hashtag. When used in conjunction with the LabVIEW bookmark manager this makes searching for specific comments in your code much more accessible.
So let’s take a look at this. In the video below we’re going to create our first bookmark in a VI and then try to find it again using the bookmark manager.
First, we create a Free Label and then add a # (hash) followed by the text we want to use as our bookmark. The bookmark ends at the first instance of whitespace at which point any remaining text becomes a comment associated with the bookmark.
So for example:
The really nice thing is that a free text label can contain multiple Bookmarks. So writing something like the following is totally ok:
You can use camel casing or underscores to highlight word separation in the bookmark text.
Note that the text between the # and the first whitespace is automatically displayed in bold.
The bookmark manager (View Menu > Bookmark Manager) can display all bookmarks in the currently loaded project/hierarchy and provides options for sorting by VI or bookmark.
Pro Tip – Free labels including bookmarks can display hyperlinks. Just add the full URL followed by space. This is super useful for linking to manufacturer datasheets from your block diagram.
If you stop reading now and start using bookmarks in your code the world will be a much happier place.
As your usage of bookmarks increases, I’m fairly confident you will find yourself using certain bookmarks more frequently such as leaving yourself a note to remind you to come back and fix something, complete some feature you were working on or simply leave a note for yourself so that in two years time when you revisit that code the bizarre inverse boolean logic you chose to implement makes some kind of sense.
I did quickly find that when multiple members of the various teams I work with on a consulting basis started using bookmarks variation and inconsistency quickly became apparent. One person’s #To-Do is another person’s #ToDo is another’s #Todo etc. This results in a more cluttered, less useful Bookmark Manager results window as both bookmarks are seen as different and therefore appear as separate entries.
This was partly the inspiration for creating Bookmark, a free tool for simplifying the creation and standardisation of bookmarks which you can get from the LabVIEW Tools Network.
Bookmark allows you to add a Bookmark directly to the block diagram of one or more VIs directly from the project window without having to open their individual block diagrams. It also allows you to quickly add up to 4 frequently used bookmarks along with providing a “Quick Drop Style” means of selecting bookmarks already used in the current LabVIEW project. There are some useful right-click options and even a quick drop plugin to assist you further. The following videos show it in action and some of the more interesting features.
If you’re not convinced then check out the online documentation here to see if this tool can help you and your team standardise your LabVIEW bookmarks.
The eagle-eyed amongst you may have spotted that this tool uses the LabVIEW Project Provider to extend the functionality of the IDE (specifically the Project window). I’ve got some really interesting things coming up with another provider-based toolkit I’ve been playing with to help with Source Code Control and can’t wait to share in the coming weeks.
See you next time 🙂