From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LVCompare

I've got a LabVIEW 7 project that has about 1000 VIs and controls, call it Lab Original.  I made a modification that involved changing about 100 VIs, adding some, removing some -- call it Lab New.  I now want to make a third version that combines some features of Original and New, but am not 100% certain which VIs have been changed, and which are essentially the same.  Everything is under Version Control (Tortoise SVN), so at least the files are easily kept organized.  However, I can't easily use Date/Time information to distinguish changed and identical files, nor can I use ordinary comparison tools as simply opening a file can often lead to a (trivial) binary change.

 

Fortunately, there's LVCompare.exe, which has the ability to compare two VIs, looking at differences in the Block Diagram without caring about the appearance, size, or position of the various objects.  This utility acts like a DOS command -- you call it from the Command Line and pass it parameters and switches -- it does the compare and gives you a three-window display of the two VIs and their differences (if any), similar to what you see if you use the LabVIEW Compare Tool.  But there are some caveats.

 

First, the two file arguments must be distinct.  There's a note that says if they are in different LabVIEW Projects, then the Project environments will be different, but I haven't figured out what this means nor how to use it (even with VIs that are truly in a LabVIEW Project).  I've "programmed around" this problem by changing the extension of one of the VIs to .tmpvi, calling LVCompare, and then renaming it back to .vi when I'm done.

 

I've "wrapped" the calls to LVCompare in a set of VIs that let me deal with the two folders holding the Lab Original and Lab New files (and folders).  I first split the set of files into "Files unique to Lab Original", "Files unique to Lab New", and "Files in both places".  Clearly I only need to run LVCompare on the latter.  I build the arguments needed for LVCompare, pass the files in, then wait for LVCompare to show me the differences.

 

The only remaining problem is that LVCompare doesn't "return" anything -- in particular, the only way to tell if two files are different is to actually look at the output of LVCompare!  What I'd really like to have is some form of output that can signal if the files are different or the same so that I can let the program crank through all of my files without having to use my own eyes as the indicator of a difference.

 

My initial trial of this system is certainly promising -- even though LVCompare can be a bit slow (a few seconds for each file), it (a) seems to work even on LabVIEW 7.0 files, (b) leaves the files that it is comparing intact, and (c) if there are files "missing" when it tries to open a VI, it simply plows ahead and does the comparison anyway after "giving up" on finding the files.

 

I have some ideas about how to trick LVCompare into telling me if there are differences or not.  If anyone has suggestions, they'd be most welcome.

 

Bob Schor

0 Kudos
Message 1 of 7
(3,829 Views)

Hi, Bob,

 

Long time ago it was also necessary for me. Somewhere I have found one "undocumented" method, so it was possible to compare VIs "programmatically".

May be it helps for you as well. Disclaimer - use it at your own risk.

 

Andrey.

 

Message 2 of 7
(3,814 Views)

Andrey,

     That's precisely what I'm hoping to find -- this looks exactly like LVCompare.  I was unable to find the application "native" in LabVIEW 2010, so I just copied your block into my code.  It worked like a charm -- the output "Same?" is precisely what I needed, and the additional "Interactive?" input lets me not even have to look at anything!

 

     Many thanks!  This saves a lot of work ...

 

Bob Schor

0 Kudos
Message 3 of 7
(3,799 Views)

I'm curious... The "UI.Cmp VIs" isn't in the drop down menu for methods. How did you get it?


@Andrey Dmitriev wrote:

Hi, Bob,

 

Long time ago it was also necessary for me. Somewhere I have found one "undocumented" method, so it was possible to compare VIs "programmatically".

May be it helps for you as well. Disclaimer - use it at your own risk.

 

Andrey.

 


 

0 Kudos
Message 4 of 7
(3,671 Views)

I use a combination of the program BeyondCompare and the LVCompare utility to do what your talking about.  The BeyondCompare I use to compare directories and to perform a binary comparison of each VI to the VI of the same name.  Once I have determined the list of changed VIs I then use theLVCompare to examine each one for specific differences.

 

Might work for you.

 

Jason

Wire Warrior

Behold the power of LabVIEW as my army of Roomba minions streaks across the floor!
0 Kudos
Message 5 of 7
(3,667 Views)

Hi,

 

I tried running the code in LabView 2010, but it gave an error saying "The property or method is not supported in this version of LabVIEW". Any Idea why this error is coming and how to work around it?

 

Also, is there an alternate method to the one you have used, native to LabView 10??

 

Thanks

0 Kudos
Message 6 of 7
(3,573 Views)

Thanks. It works at LV2019.

 

0 Kudos
Message 7 of 7
(2,294 Views)