====== 92 LabVIEW Compare ====== //The Compare VIs feature helps you track changes in an application by comparing multiple versions of a VI using graphical differencing. // Both compare tools, the one in the IDE and "LVCompare.exe", are available only in the LabVIEW Professional Development System. ===== In the IDE ===== 1. Open the tool from the //Tools// menu: {{:kb:labview:lvcompare-ide-1.png?400|}} 2. In the dialog, select the VIs you want to compare: {{:kb:labview:lvcompare-ide-2.png?600|}} ---- ===== Externally ===== The ''LVCompare.exe'' (and LVMerge.exe) tools can be used stand-alone or from other tools like SCC to compare VIs. You can find the executable in C:\Program Files (x86)\National Instruments\Shared\LabVIEW Compare\LVCompare.exe The tool takes the following arguments: * Absolute path to first VI * Absolute path to second VI (must be named differently to first VI) * optional: ''-nobdpos'' (ignore position of nodes on block diagram) * Optional: ''-nobdcosm'' (ignore cosmetic aspects of block diagram) An example call could look like this: LVCompare.exe “$LOCAL” “$REMOTE” -nobdpos -nobdcosm ---- ===== SCC Integration ===== There are a few incompatibilities between the [[https://git-scm.com/docs/git-diff|''git diff'' command]] and ''LVCompare.exe'': * git uses Linux-style forward slashes "/" where LVCompare requires Windows-style back slashes "\" * git uses paths relative to the repo root directory where LVCompare requires absolute paths To work around these limitations, NI provides the [[https://forums.ni.com/t5/Example-Code/LVCompare-Adapter-for-GIT-Extensions/tac-p/4193505|LVCompare Adapter for Git Extensions]] through its Example Code platform. There is another challenge with most modern git client applications: * git can work with directories or files (ie git will compare two versions of the same file - same name - in different directories), where LVCompare requires two files with non-identical file names LabVIEWfriend Stefan Lemmens [[https://forums.ni.com/t5/WUELUG-Würzburg-LabVIEW-User/Set-up-Fork-for-GitLab/m-p/4199192/highlight/true#M336|patched the adapter]] mentioned above to also fix this third issue and shared it on the NI forums. ==== How to ==== 1. Download and install the [[https://forums.ni.com/t5/Example-Code/LVCompare-Adapter-for-GIT-Extensions/tac-p/4193505|LVCompare Adapter for Git Extensions]] 2. Download the [[https://forums.ni.com/t5/WUELUG-Würzburg-LabVIEW-User/Set-up-Fork-for-GitLab/m-p/4199192/highlight/true#M336|patch provided by Stefan Lemmens]] and extract its contents to a temporary location 3. In the Adapter's installation directory ''C:\Program Files (x86)\National Instruments\LVCompare Git Adapter\'', replace the existing .exe with the one from Stefan Lemmen's patch 4. Configure your git client to point to the patched Adapter (this setting is usually called //Diff Command// or //Diff Tool Path//): C:\Program Files (x86)\National Instruments\LVCompare Git Adapter\lvcomparegit.exe