Comparing Two VIs in LabVIEW

Updated Nov 18, 2020

Reported In

Software

  • LabVIEW Professional

Issue Details

  • I have two different versions of the same VI. How can I efficiently compare them and find differences and similarities?
  • I cannot locate the Compare VIs tool in LabVIEW.
  • Do I have different options to compare two VIs?

Solution

There are two LabVIEW built-in methods to compare VIs: The VI Comparison Tool and LVCompare.exe. Both of these methods require LabVIEW Professional Development System. If you don't have LabVIEW Professional Development System, you can try programmatically comparing VIs.

Before beginning with the methods below, check your LabVIEW version and ensure that you have LabVIEW Professional Development System. If you do not have LabVIEW Professional Development System you are required to upgrade your license to gain access to this tool.
 

VI Comparison Tool

  1. Open the two VIs you want to compare. This will load them into LabVIEW's memory.
  2. On one of the VIs, open the VI Comparison feature by selecting Tools»Compare»Compare VIs... This will bring up the Compare VIs dialog box (below).
    • If you are not in a VI (and instead in the project level), the Compare VIs... option will be grayed out.


       
  3. In the dialog box, select the VIs you want to compare. 
  4. Choose which items from the VI you would like to compare by placing a check next to that item (e.g., Front Panel, Block Diagram, etc.)
  5. When you have selected the VIs to compare and the attributes to compare, click the Compare button. This will bring up the two VIs side-by-side with the Differences dialog box below.
  6. Explore the difference between the VIs.
    • Click on a difference in the left pane to see its details. The details will describe what type of difference each item is referring to (e.g., Deleted/Added item, Value difference).
    • Place a check next to the Circle Differences option. This will place a red circle around the item in each VI that a particular difference is referring to.
    • Click on the Show Detail button, and it will highlight the particular detail you have selected for a particular difference (and also place a check next to the detail).
 

LVCompare.exe

Use the windows command line to start the LVCompare.exe. In the command line, type the following:
lvcompare.exe <absolute path to VI 1> <absolute path to VI 2> [-lvpath <path to LabVIEW>][-noattr][-nofp][-nofppos][-nobd][-nobdcosm][-nobdpos]
  • -noattr means do not compare VI attributes
  • -nofp means do not compare the front panels
  • -nofppos means do not compare the size or position of front panel objects
  • -nobd means do not compare the block diagrams
  • -nobdcosm means do not compare the appearance of block diagram objects
  • -nobdpos means do not compare the size or position of block diagram objects.​​
You can also configure a third-party source control provider to use LVCompare.exe  as the default comparison tool.