LabVIEW Public Beta Program in 2024

cancel
Showing results for 
Search instead for 
Did you mean: 

Preview Feature in LabVIEW 2024 Q1: Modified Algorithm for Compare VIs (“Diff”)

This post is about the "first phase" of feedback on "Compare VIs." The second phase is in the LabVIEW 2024 Q3 Beta: New Beta Feature: Improved Compare VIs (“Diff”) - NI Community

 

------------------------------------------------------

Note: Although we are using the Beta forum to gather feedback on this feature, the functionality is in the released LabVIEW 2024 Q1, and can be enabled with a config token. Note that this Preview feature is not a fully-supported feature of LabVIEW 2024 Q1 and is Beta quality.

 

This feature enables changes to the algorithm for comparing VIs. The modified algorithm produces better results when comparing two versions of the same file (also known as “diff”), which is a common workflow with source code control.

 

Section 1. Enabling the Modified Comparison Algorithm

  • (Windows) In the LabVIEW .ini file, add the line: LVCompare.MatchUIDs=True
  • (Linux) In the labview.conf file in ~/natinst/.config/LabVIEW-2024, add the line:
    LVCompare.MatchUIDs=True

Section 2. How to Use the Modified Comparison Algorithm

“Diff” VIs as you normally would, e.g., by invoking Tools»Compare»Compare VIs.

 

Section 3. Requested Feedback

If you enable this feature and find that LabVIEW incorrectly matches objects when comparing two revisions of a VI, please report it here. If possible, please provide the VIs or a screenshot of the comparison.


Christina Rogers
Principal Product Owner, LabVIEW R&D
Message 1 of 7
(1,250 Views)

@Christina_R wrote:
  • Section 2. How to Use the Modified Comparison Algorithm

“Diff” VIs as you normally would, e.g., by invoking Tools»Compare»Compare VIs.

 


Question: Does the new behavior only occur when using the Tools Menu? Does it also occur when using the LVCompare.exe from the Command Line?

Sam Taggart
CLA, CPI, CTD, LabVIEW Champion
DQMH Trusted Advisor
Read about my thoughts on Software Development at sasworkshops.com/blog
GCentral
0 Kudos
Message 2 of 7
(976 Views)

@Taggart wrote: Question: Does the new behavior only occur when using the Tools Menu? Does it also occur when using the LVCompare.exe from the Command Line?

The modified algorithm will be used for LVCompare.exe as well as the Tools menu.

 

By the way, I realize that there are other issues with Compare VIs that will not be solved by this change, and we are working to address those in an upcoming release as well. So please feel free to share any examples where you "diff" VIs and get poor results.


Christina Rogers
Principal Product Owner, LabVIEW R&D
Message 3 of 7
(964 Views)

Here's a tool I made for my team for reviewing code, it uses LVCompare.exe but with a few changes it could be so much better....

You point it to the working git directory for your repo, then it clones the Base branch to a temp location. I then do a simple binary not equal to see what files are changed (I always separate compiled code). For my ~5000 VI repo this takes about 90s. Then I can display a list of modified added and removed files. Then when you click each item it launches the LVCompare UI.

hunter_jki_1-1707417029375.png


I wish the automated scan could do some filtering so I could the reviewer can know which are real changes they need to look at. For larger change sets opening evey VI into the LVCompare UI is overwhelming and very time consuming, especially when most changes are tiny non-code changes.

 

I want a fast way to get these flags then my tool could prescan, and just let a reviewer look at "Real" changes based on some flag configs. Mostly I want to be able to filter out non-wiring changes. I am scared to update a class icon cause it is soo noisy in the review.

  • FP changes?
  • BD Changes?
    • cosmetic BD changes only
  • Relinked SubVIs?
  • Updated Type Defs?
  • Icon Changes?
  • Overall number of changes


0 Kudos
Message 4 of 7
(936 Views)

@Christina_R wrote:

@Taggart wrote: Question: Does the new behavior only occur when using the Tools Menu? Does it also occur when using the LVCompare.exe from the Command Line?

The modified algorithm will be used for LVCompare.exe as well as the Tools menu.

 

By the way, I realize that there are other issues with Compare VIs that will not be solved by this change, and we are working to address those in an upcoming release as well. So please feel free to share any examples where you "diff" VIs and get poor results.


I am extremely happy that NI is investing in this. Major kudos!

Another question I have is: If I have a machine that has an older version of LV installed (say 2020) is it possible to install the newer version of LVCompare onto that machine without upgrading LabVIEW?

Sam Taggart
CLA, CPI, CTD, LabVIEW Champion
DQMH Trusted Advisor
Read about my thoughts on Software Development at sasworkshops.com/blog
GCentral
Message 5 of 7
(935 Views)

With a commandline LVCompare tool that returns flags I could also make a tool that runs in CI and add github/bitbucket annotations so you could see what changes right in a pull request. That would be so handy.

0 Kudos
Message 6 of 7
(934 Views)

@Taggart wrote:
Another question I have is: If I have a machine that has an older version of LV installed (say 2020) is it possible to install the newer version of LVCompare onto that machine without upgrading LabVIEW?

As far as I know, we don't have a separate installer for LVCompare, so no, it's not upgradeable independently of LabVIEW. It just invokes LabVIEW to do the comparison, though, so there wouldn't be much value in upgrading it separately.


Christina Rogers
Principal Product Owner, LabVIEW R&D
0 Kudos
Message 7 of 7
(719 Views)