Using new LabVIEW Merge Tool LVMerge With TortoiseSVN
LabVIEW 8.5 includes a new visual merge tool LVMerge that can be called from external source code control program for three-way VI merging. I’ll go trough the steps required to integrate LVMerge with popular TortoiseSVN source code control client.
If you have edited a VI that is under source code control, occasionally someone else may have edited the same VI after you have checked it out. As a result the two versions of the same VI are likely differ from each other. In three-way merging, these two different versions of the VI are compared agains a common base version of the VI. This way the merge tool can identify which of the changes have occured in both of the modified version since the VI was last checked out. LVMerge is a three-way merge tool and allows developers to visually compare all three versions of the VI. For each modification in either of the two modified version of the VI developer can choose if the modification should be ignored or included.
Setting up TortoiseSVN
To set up LVMerge with TortoiseSVN, right click on a directory under souce code control and select
from the right-click menu and and then
from the appearing submenu. TortoiseSVN Settings screen will open.
Select Merge Tool from the tree menu on the left and press Advanced… button on the right to open the advanced merge tool settings.
![]()
No, let’s define that files with extension .vi shall be merged with LVMerge. Tio do this, click Add… button. A dialog window with two fields Extension and External Program will appear.
For the Extension field fill in
.vi
For the External Program field fill in
“C:\Program Files\National Instruments\Shared\LabVIEW Merge\LVMerge.exe” “C:\Program Files\National Instruments\LabVIEW 8.5\LabVIEW.exe” %base %theirs %mine %merged
If your LabVIEW installation directory is not under C:\Program Files\National Instruments, mofify the path respectively.
Press Ok for all the open windows and you are done setting things up.
Accessing LVMerge to Resolve Conflicts
Now we are ready to resolve conflicted VIs. When TortoiseSVN encounters a conflict, it layouts a exclamation point on top of the file icon on windows explorer. The exclamation point indicates that the file is conflicted and that you need to manually resolve the conflicts.

To resolve the conflicts, right click on the conflicted file and select
and
from the appearing context menu. Now TortoiseSVN will call LVMerge to allow you to resolve the conflicts. LVMerge is a rather intuitive tool and I’ll not go into detail how to use it. You’ll come along.
After you are done with resolving conflicts, save the file with the proposed name and quit LVMerge. TortoiseSVN doesn’t automatically know that the conflicts are now resolved but you still need to thell this to TortoiseSVN. You can tell TortoiseSVN that all conflicts are now resolved by selecting
and
from the right click menu of the conflicted file. After you have resolved all conflicts in your project, you can commit your changes to the repository.
Note! When resolving conflicts this way, the merged version gets saved on top of your own version of the VI. If you make mistakes in the merge process, you may accidentally loose your own changes to the VI. This is a feature of TortoiseSVN.
Don’t forget to read Jim Kring’s recent post Using Beyond Compare as your TortoiseSVN Diff Program for ZIP Archives at Thinking in G.
15 Comments
Make A CommentComments RSS Feed TrackBack URL
Leave a comment
You must be logged in to post a comment.


August 28th, 2007 at 7:31 am
Just a couple of typos – “sips of the flingers” as I like to call them. But, besides those few “glitches” it’s a very good explanation. I’m wanting to begin using SVN but, having had a rather bad prior experience, have become very cautious. Knowing how easily the LVMerge tool can be integrated into SVN makes me feel more confident that migrating to SCC under SVN will actually work. Thanks for the tips!
August 28th, 2007 at 1:37 pm
We’ve been using SVN for a couple of months now. There has been some difficulties but compared to situation when we didn’t use SCC I guarantee it’s a big improvement.
We initially used an older version of subversion server that already was provided as a service by our University. It seems that there was a bug in this version of subversion that caused troubles when committing large LabVIEW projects; the server freezed due to memory leakage. So use the latest version of subversion only.
Furthermore resolving conflicts with LabVIEW class files in not always straight forward. The class files are XML documents with some binary encoded content. TortoiseSVN can merge the non-binary content but not the binary content. I’d love to see that LVMerge would be extended to all LabVIEW file types, not only VIs.
September 4th, 2007 at 9:57 pm
A couple comments:
* I couldn’t get this to work with the command line you listed (Tortoise displays an error dialog saying it can’t find the file specified). I managed to get it to work using “C:\Program Files\National Instruments\Shared\LabVIEW Merge\LVMerge.exe %base %theirs %mine %merged” (no quotes).
* Why can’t I get a lock on a VI that has conflicts? This makes this almost useless, unless we take the leap of removing the “needslock” property. The merge tool works great, but when it comes time to save the VI, I can’t (since it’s locked and therefore read-only), and Tortoise won’t let me get a lock on it (if I select “Get Lock”, the “Lock Files” dialog file list is empty).
September 24th, 2007 at 12:44 pm
Was successful in getting SVN merge to work with a subset of the command line (i.e. comment #3) and worked extremely well. It would be nice to see LVMerge expanded to all NI file types.
One thing I have been trying to get to work also is the compare feature. It appears to work diffrently than the LVmerge feature. Is there a way to setup the compare feature in SVN also?
September 25th, 2007 at 9:30 am
Regarding the compare tool, there is not command line counterpart. One can naturally try to write a wrapper for the compare utility that ships with LabVIEW 8.5 professional that could be accessed from command line. However it may not be trivial…
September 26th, 2007 at 9:19 pm
If you want to do a LabVIEW compare you should check out MetaDiff.
http://meta-diff.sourceforge.net/
I have used the LVdiff tool successfully with SVN.
When NI finally send us our copy of LV8.5 I will finally have a complete suite of tools that work with subversion.
October 29th, 2007 at 7:44 pm
“C:\Program Files\National Instruments\Shared\LabVIEW Merge\LVMerge.exe” “C:\Program Files\National Instruments\LabVIEW 8.5\LabVIEW.exe” %base %theirs %mine %merged
The above command line works for me. I guess the blog editor has changed the double quotes I used into some unicode characters that are not actually ascii versions of the double quotes.
January 17th, 2008 at 11:28 am
Thanks for your help which allowed me to install LVmerge & LVdiff in TortoiseSVN.
I have a basic query: everytime a Vi is moved location (like in checking out to a new user/location), it is recompiled and marked “modified”, hence every checkout can potentially generate a new revision?! How to avoid this very confusing LabView “feature”.
January 24th, 2008 at 11:20 pm
Used the command line that was suggested by Jaegen in comment #3. Works amazingly well. I am impressed.
March 28th, 2008 at 9:32 pm
I get the following after resolving conflicts:
Error: An unknown error occurred while accessing H:\SVN Sandbox2\asdf.vi.
Resolved: H:\SVN Sandbox2\asdf.vi
Anyone else get the same? The conflicts are resolved, I’m able to Commit, everything is fine, I’m just curious if that error means anything and if others see the same.
July 17th, 2008 at 12:33 pm
Hi,
If you were programming in LabVIEW 8.2.1 but had LabVIEW 8.5 installed on your machine would the LVMerge.exe still work in that situation, or do you have to actually be working in LabVIEW 8.5 ?
just curious really
cheers
Danny
August 8th, 2008 at 10:15 pm
LVMerge works pretty well, but somehow after I finish editing my conflicts, I cannot set my file to resolved using tortoise. I get the following error:
Error: An unknown error occurred while accessing C:\Development\TestRepository\RandomNumberDisplay.vi.
Anyone else experience the same? For non-labview files, resolving conflicts is fine.
August 15th, 2008 at 10:46 am
Hi Arranny, I get the same error as you, i.e. I can’t use the ‘Conflict resolved…’ feature of TortoiseSVN.
As a workaround I (after merging) manually deleted the files ‘test.vi.r8′ and ‘test.vi.r9′. Then the menu entry ‘Conflict resolved…’ is not available any more, but I can do a normal ‘SVN Commit’ and all seems to be fine.
I don’t know if there are side effects, however.
(BTW, I use Tortoise 1.5.2, while Tomi Maila’s originally posted his recipe when version 1.5.x was not out yet)
September 17th, 2008 at 9:53 am
[...] Comments Franz on Using new LabVIEW Merge Tool LVMerge With TortoiseSVNRolf Kalbermatter on External Code in LabVIEW, Part2: Comparison between shared libraries and [...]
March 7th, 2010 at 7:26 pm
Great article – I’m a big Subversion fan. I thought you all might want to know about some recent improvements to our interface with TortoiseSVN. In LabVIEW 2009, we extended the compare tool so that it can be called as an executable – to set it up, just put this in for vi and ctl extensions:
“C:\Program Files\National Instruments\Shared\LabVIEW Compare\LVCompare.exe” %mine %base
Also, I highly recommend adding ‘skipSVNFolders=true’ to the labview.ini file. We added this option in 2009 (will be on by default in 2010) so that LabVIEW will not attempt to mass-compile the contents of hidden directories. It also addresses a few other issues with auto-populating folders and the search feature.
More info can be found here: http://zone.ni.com/devzone/cda/tut/p/id/9407