LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Bob_Schor

Make "guts" of LVCompare available as an Invoke Node (to call programmatically)

Status: Declined

Any idea that has received less than 4 kudos within 4 years after posting will be automatically declined.

I need to compare two almost-identical folders of VIs (two versions of the same project) to see which VIs are "substantially the same" and which are different.  There's a Command Line utility, LVCompare.exe, that has much of the functionality of the LabVIEW Compare Tool -- indeed, it has additional switches to allow you to ignore cosmetic changes in your Block Diagram so you can move a wire without it saying the VI is different.  One serious drawback to this utility, however, is that it has no "return code" -- you have to actually look at the Compare screen and note if there are 0 Differences (or not).

 

However, using a command-line utility when you want to compare, say, 1000 VIs is painful, particularly in the absence of a "Same?" switch.  I would like to have something like an Invoke Node, to which I could wire references to the two VIs I want to compare, perhaps a boolean input to control whether or not the utility was "interactive" (it would be nice to turn off the "comparison view" if I was just going to "batch process" a lot of files), six booleans for the six LVCompare switches, and a boolean Same? outout.  With this, an enterprising user could easily cook up a nifty utility to help maintain multiple versions of LabVIEW code, noting which VIs are the same and which are different.

 

As it happens, exactly such a User Interface node to the LV Compare utility appears to exist, but is not "publically available".  As noted above, making it available would make the LabVIEW Compare tool truly useful -- as it currently stands, there really is no other way to easily tell if two VIs are, or are not, "substantially" the same, due to the binary nature of VIs and the tendency to recompile them even when nothing appears to change.  Thus a simple "binary compare" or "date/time compare" won't do the trick.

15 Comments
Bob_Schor
Knight of NI

Hmm.  The LVCompare utility might not be "ready for prime time".  I've embedded calls to it within a LabVIEW Utility I wrote that tries to do a file-by-file comparison of two folders containing separate versions of a project (about 900 VIs).  The program seems to run correctly, but there are VIs that are certainly different that come out flagged "Same".  Curiously, if I only try comparing the folder that my "different" VI is inside (instead of comparing, say, the folder containing the folder of my VI), it works!  Not sure what is going on, but this does seem to be a "data-driven" bug/feature.

AristosQueue (NI)
NI Employee (retired)

What options did you pass to LVCompare.exe? It has options for ignoring a lot of cosmetic details, and that may be the default.

Bob_Schor
Knight of NI

I pass a cluster of 6 booleans, one for each option.  That wasn't it -- it was a "Stupid Programmer Error".  For each pair of files, I had created a VI Reference, but forgot to do a Close Reference.  So after a few hundred calls, "mysterious errors" (or better yet, "incorrect performance") started popping up.  Sigh -- just when I'm really pleased with myself, I do something stupid!  Keeps me humble ...

Bob_Schor
Knight of NI

I posted a common on another forum that led to DavidS (from NI) to ask me to post the Secret Node.  It was explained to me that this was "unsupported" by NI, as it hadn't undergone extensive testing, but since it was passed to me by a Forum member, it seems only fair that I return the favor.  To use, you simply wire error lines in and out, do not wire anything to the input/output Reference node, then wire the nodes inputs and outputs as you wish.  Note that "Interactive?" turns on and off the "show me three windows so I can see the differences", the six booleans at the bottom "turn on" the various selection options (FP? and BD? are "True" in the LV Compare Tool), "Same?" is the output, and "Description" seems to be empty.  Enjoy (at your own risk ...).

 

Bob Schor

Compare VI Node Snippet

danny_t
Active Participant
Not an idea solution to your problem but if you created in each folder a "Tree VI" containing all the VI's in each folder, you could then use the "Compare VI hierarchies" tool. This will show you which VI are the same / different in each hierarchy. In fact I had forgotten about this tool and it does look like something that could be expended and put to a lot better use. Interesting to see about this Invoke node though. cheers Danny
Danny Thomson AshVire Ltd
Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 4 kudos within 4 years after posting will be automatically declined.

kevanA
Member

Sorry that this feature was denied. Thanks for the snippet. Very helpful.

James@Work
Member

Dang, that Invoke Node was awesome until after I completed an amazing App only to learn it does not work in an executable; LV2018.

UI.Cmp VIs Error.png

 

I think this feature request needs to be reconsidered/resubmitted; I'd guess most users never saw it when originally posted.

Tech Advisor - Automation
LabVIEW 5.0 - 2020
AristosQueue (NI)
NI Employee (retired)

James@Work: The run-time engine does not have any block diagram code. It doesn't know about source code at all, so it cannot do comparison. Adding to the RTE that would significantly expand the size of the RTE, something we (believe it or not) try not to do. It could be broken out as a separate DLL, but that is a substantive undertaking that I do not expect LabVIEW 20xx to ever do. LabVIEW NXG, on the other hand, already has the source model broken out separately, and providing such tools in a built application, while not possible today, is at least potentially possible in the future.

wiebe@CARYA
Knight of NI

You should however (I think) be able to invoke this method from an executable with an application reference to a LabVIEW development environment?

 

That would allow to package the functionality, and make the executable perform a compare, as long as there is a development environment installed.