LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
avogadro5

Add app references to LVMerge API

Status: New

"<LabVIEW 20XX>\project\procmphier.llb\CMP Compare two VIs.vi" is an excellent VI that lets us develop tools to address some shortcomings of "raw" LVCompare.exe.

 

There should be a similar VI to open the LVMerge dialog.

 

The part of "CMP Compare two VIs.vi" that I find most useful and would be invaluable for LVMerge is the option to pass in different AppRefs, which lets us load different versions of VIs with the same name and compare them, thus providing a path to eliminate all the breakages associated with renaming files (eg "claims to be part of library," "could not find class with this name...").

 

There are some tantalizing VIs in "project\_promergevis.llb\NI_promergevis.lvlib" but there doesn't seem to be a public means to open the VIs in different application instances.

3 Comments
wiebe@CARYA
Knight of NI

If you enable scripting and the secret stuff, you have methods that give you these abilities. At least, it looks that way:

wiebeCARYA_0-1693295028478.png

The functions take VI references, and these can probably be from different app references.

avogadro5
Member



That definitely seems to work, thanks!

avogadro5
Member

Attaching a rough proof of concept for why the app ref option is important in case NI wants to make it more public. This only requires LabVIEW 2021+ and git in your PATH. Due to the file path strings, this is Windows specific but would probably be easier in Linux...git_lvmerge.png

Won't let me post the VI here but here's an attempt at a snippet...

Usage:

  • Select a "Repository with merge in progress"
    • This is a folder in a git repository where there are "unmerged files" that are VIs (in TortoiseGit these show up in the "Resolve..." dialog)
  • Start the VI
  • Wait...
  • Conflicted VIs should ungrey
    • Double clicking a row should open a LVMerge dialog, where the 4 copies of the conflicted VI are each in unique app instances
    • Saving the ouput VI of LVMerge saves it in the original location in the repository folder you selected

Behind the scenes, we create 3 additional copies of the working copy, as LabVIEW will yell at you if you have different VIs of the same name at the same path on disk, even in different app instances... but it won't if they are at different paths and different app instances. The net result of all the copying and extra app instances is that everything should compile in all 4 windows (so won't have to go searching for missing files, won't complain about renames, etc...) even if there were renamed dependencies of the VI across the branches.