Reference Utility for Programmatically Comparing (Diffing) VIs

Publish Date: May 04, 2010 | 5 Ratings | 1.80 out of 5 | Print | 2 Customer Reviews | Submit your review

Overview

When developing a large application, it sometimes becomes necessary to compare (or 'Diff') several VIs at once, during a code iteration or review, for example. In this case, it may not be ideal to open each pair of VIs to be compared using the Compare VIs option in LabVIEW. The attached utility demonstrates how a user can programmatically compare their VIs. Simply call this utility inside a loop, passing it the paths of the VIs that the user wishes to compare. The VI will return whether or not there was a difference along with a textual description of what was different, which is very useful if a report with the differences is necessary. The attached VI (vi_diff.vi) uses the CMP Compare two VIs.vi, which is located in \project\procmphier.llb. Please note that the attached VI uses the LabVIEW 8.0 directory so if you have a later version of LabVIEW, please update the location of the CMP Compare two VIs.vi to your LabVIEW directory.

**The accompanying code represents a very specific use case for NI products. For more general examples, please refer to ni.com/examples, the LabVIEW Example Finder, or the NI driver help files that come with every NI driver.

Inputs

Path of VI 1: The path for the first VI you want to compare.

Path of VI 2: The path for the second VI you want to compare.

VI Attributes: Compares attributes of the two VIs using the settings in the VI Properties dialog box.

Front Panel: Compares objects on the front panel.

Front Panel Position/Size Changes: Compares the position and size of the objects on the front panel.

Block Diagram: Compares the functional differences on the block diagrams.

Block Diagram Cosmetic Changes: Compares changes on the block diagrams that do not affect the execution of the VI, such as color changes, visible subdiagrams in Case and Stacked Sequence structures, format and precision of constants, and Event structures.

Block Diagram Position/Size Changes: Compares the position and size of the objects on the block diagram.

Outputs

Same?: Boolean indicator indicating whether or not a difference was found between the two VIs.

Differences: A string indicator with descriptive information about what the difference between the two VIs was.

Back to Top

Customer Reviews
2 Reviews | Submit your review

Not very usefull  - Dec 3, 2012

This compare vi, reports vi's with the same name but different paths as the same, allways.

Please include the sub-VIs  - Oct 3, 2007

Please include the sub-VIs.

Bookmark & Share


Downloads

Attachments:

vi_diff.vi

Requirements


Ratings

Rate this document

Answered Your Question?
Yes No

Submit