One of the exciting new features of LabVIEW 2013 was the introduction of bookmarks. Bookmarks are a special tagging mechanism that can be added to a VI Block Diagram. Any text that starts with a hashtag ( # ) will automatically be identified by LabVIEW as a bookmark. These can be used for marking to-do items or unfinished tasks in different parts of code. When you add a hashtag to a block diagram comment, LabVIEW detects a bookmark and bolds the bookmark tag to distinguish it from the rest of the text, (for example: "#TODO revise algorithm") .
The Bookmark Manager is a tool for viewing all bookmarks in a project or application instance. It can be accessed from the View > Bookmark Manager menu item. When you open the built-in Bookmark Manager, it shows the bookmark and any comments that follow it. You can also double click any bookmark entry and it will open the VI where it exists and highlight the location on the block diagram. From the bookmark manager, you can also change the project in which you are viewing bookmarks and change the view.
The LabVIEW Bookmark Manager is very simple and useful, but its true power comes from its customizability. The bookmark API has a fully open interface which can be used to create your own custom bookmark manager. You can even copy and edit the built in manager to help get you started since the Bookmark Manager is also open and unlocked.
The bookmark manager API is built on the VI Server interface to programmatically access and manipulate the Bookmarks of a VI. If you are not familiar with VI Server, it may be helpful to first read up on this at "What Is the VI Server?" and "Capabilities of the VI Server". Along with the existing VI Server interfaces, the bookmark manager API adds 4 more important Events and Methods specific to bookmarks:
The Get VI Bookmarks method will return all the bookmarks associated with a certain VI. This method uses a VI reference and works for all VIs in memory, including those that have not been saved to disk.
The Get VI: Bookmarks method is similar to the Get VI Bookmarks VI Method, except it is a method for the Application class. This method uses a VI Path for input and works for any VI on disk, even if they have not been loaded into memory.
Note: Bookmarks are stored as a VI resource on disk but are kept up to date in memory. This means that a VI does not have to be in LabVIEW's memory in order to read its bookmarks.
This method will convert a bookmark ID to an object reference. Note: Bookmarks are referenced by "Bookmark IDs" because Object References are only valid for VI's loaded in memory.
This is an application event that is generated when a user changes the bookmark of a VI. This can be handled in a LabVIEW Event Structure.
When creating your own bookmark manager, you may start from scratch, but it may help you save time to use the existing bookmark manager as a starting point. Complete the following steps in order to copy the existing bookmark manager code:
Once you have multiple Bookmark Manager's located in the labview\resource\dialog\BookmarkManager\managers directory, LabVIEW will allow you to select between them when you choose to launch this from the View menu. You may choose not to show this selection dialog, but anytime a new bookmark manager is found it will prompt again allowing you to change to the new one.
Once you have created your own bookmark manager dialog, it may be helpful to distribute this using VI Package Manager. This will allow your users to easily install the files in the right directory and mass compile the VIs to the current version during installation. To do this, all you need to do is add a custom destination in the VI Package Builder for your project as shown below. More details on using VIPM to build a package can be found in the document VI Package Manager: An Introduction
If you think other users in the world would benefit from your new Bookmark Manager, consider submitting it to the LabVIEW Tools Network as either a free download or a paid product. More information on how to submit can be found at Contribute a LabVIEW Add-On to the Tools Network.
To demonstrate how you can modify and add features to the existing Bookmark Manager, this modified version demonstrates the information discussed in this document. This new version adds an image control on the right side of the dialog that shows a preview of the block diagram code surrounding the selected Bookmark. The image panel is resizable and the default window and panel sizes are saved between sessions. The example can be downloaded and installed from VIPM at vipm://ni_bookmarkmanager_bdpreview