From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

Diff and Merging LabVIEW .vi's within Perfoce

I need help configuring Perfoce to use LVMerge and LVCompare.

 

First I will mention that I have been researching this topic, I have read several resources, I am close but still not quite there in getting it to work. I have read the following so far:

 

Diffing Files in LabVIEW with Perforce?

Source Code Control and Group Development Resources for LabVIEW

Using Source Code Control with LabVIEW 7.x and Perforce

Perforce diff

LabVIEW and source control: graphical differencing

Configuring Source Control with LVMerge.exe

Configuring Source Control with LVCompare.exe

 

I want to be able to do this from perforce itself, not from LabVIEW. I want to be able to compare/merge to different vi's is appropiate as well as different revisions of a vi. Either I missed it, but in each of the above resouces a specific example of the perforce setup is missing - I'm hoping we can put this to rest for future people by providing a more detailed explanation.

 

I am using LabVIEW 2011 profeshional and Perforce  2010 and 2011.1

 

I am able to execute a LVCompare.exe command via a windows command line, and this works:

 

>"C:\Program Files\National Instruments\Shared\LabVIEW Compare\LVCompare.exe" "c:\source LV2011\Scheduler\Scheduler - Parameters Global.vi" "c:\source LV2011\Scheduler\Scheduler - Mapping Global.vi" -lvpath "C:\Program Files\National Instruments\LabVIEW 2011\LabVIEW.exe" -nofppos -nobdcosm -nobdpos

 My current setup in perforce is as follows:

 

Extension: .vi

Application: C:\Program Files\National Instruments\Shared\LabVIEW Compare\LVCompare.exe

Arguments: %1 %2 -lvpath "C:\Program Files\National Instruments\LabVIEW 2011\LabVIEW.exe" -nofppos -nobdcosm -nobdpos


perfoceLVCompare.png

 

When I attempt to test this within perforce, performing a diff, I get the following error:

 

LVCompareError.png

 

Can anyone pick out what is wrong with the set up? Is there something that I'm missing? Any suggestsion would be appreicated.

 

0 Kudos
Message 1 of 10
(5,659 Views)

Try putting the quotes around the %1 and %2, so you have "%1" and "%2".

0 Kudos
Message 2 of 10
(5,653 Views)

Thanks for the suggestion. I tried changing the arugments configuration to: "%1" "%2" -lvpath "C:\Program Files\National Instruments\LabVIEW 2011\LabVIEW.exe" -nofppos -nobdcosm -nobdpos with the same results, LVCompare.exe still indicates there is a problem

0 Kudos
Message 3 of 10
(5,650 Views)

You may have to wirte a VI just to spit out the command line to help you debug.  That's what I had to do with one VCS I was testing.  I think in that instance, I found that the VCS wasn't giving full paths to the VIs since both were in the current directory.

0 Kudos
Message 4 of 10
(5,645 Views)

I tried another approach with LVCompare.exe, I rather not do it this way but if there is no other way I will accept that (for now 😛 )

 

Again, I am using LabVIEW 2011 and Perfoce 2010 and 2011.1

 

I could get LVCompare.exe to work using the command line between two different files, but I could not get it to work through perforce settings. So I created a batch file and instructed perforce to use that. The settings look like the following:

 

LVCompare.png

 

The following command is in the batch file:

"C:\Program Files\National Instruments\Shared\LabVIEW Compare\LVCompare.exe" %1 %2 -lvpath "C:\Program Files\National Instruments\LabVIEW 2011\LabVIEW.exe" -nofppos -nobdcosm -nobdpos

 

This works, so I believe there is a issue either with:

(1) perforce has an issue passing command line arguments

OR

(2) LVCompare as a command line arguemnt issue, but I do not this that is the case

 

I will keep this open for a little longer for others to figure this out without using a batch file (I would attache the batch file but that is not allowed)

 

0 Kudos
Message 5 of 10
(5,644 Views)

Hi Louis,

 

I believe I have found the root of your problems. In your screenshots, you pass the arguments to "LVCompare.exe" in the Edit File Type window, and doing this will return the "LVCompare was called with incorrect parameters" error. If you leave the arguments window as is in Edit File Type, and instead configure the arguments in the Preferences window, everything should work properly. I've attached a screenshot for reference: 

 

diff config.jpg

 

Please reply if you have any additional questions. 

 

Best,

Dan N

Applications Engineer

National Instruments 

0 Kudos
Message 6 of 10
(5,619 Views)

@Dan N:  I received the same result as before.  so the file types customization recognizes the file ending, but the parameters are not being parsed by LVCompare.

 

Using the LV Example, CommandLine.vi, I built an executable to look at the application arguments.

1 = application name (ok)

2 = Abs. Path to VI 1  (great)

3 = Abs. Path to VI 2 (super)

4 = marker to change LVPath ("-lvpath")

5 = first part of path to LV application (???)

6 = 2nd part of path to LV application (!?!)

 

It seems that the space in "LabVIEW 2011" breaks the application path into two filenames.   So a quick DIR -x to find the abbrev. name gave me .../LabVIEW~3/labview.exe

 

Providing the correct path to the CommandLine application, arguments are in the order requested by the LVCompare error dialog.

 

Using LVCompare error dialog, correct, but in this case, it gave a new !@#$!@$! error message:

An error occurred while running LVCompare.

NI_LVConfig.lvlib:Load.vi<ERR> D:\Data\Temp\LVCompare.ini

 

 

I did set my LV Data Path to d:\data\temp

 

0 Kudos
Message 7 of 10
(5,473 Views)

Hello,

 

my problem is slighly different. I use LabVIEW 2012 f5 and Perforce 2012.1

I want to use LVCompare from LV environnement.

 

The compare tool works well inside LV, when using two VIs with different names.

 

My problem is that when I want to compare 2 versions of the same VI, using Perforce, LVCompare launches and everything is blocked. I have to kill tasks both for LVCompare and LabVIEW.

 

 

 

 

Any suggestion for that problem ?

 

with many thanks

 

Philippe

0 Kudos
Message 8 of 10
(5,408 Views)

I was having the same problems using LVcompare with Perforce 2014 juli 01 and Labview 2012  SP1

 

Dan_N's solution didn't help.

 

 

However, what did help for me was changing the position of the -nofppos argument in the Edit File Type dialog:

 

%1 %2 -nofppos -nobdcosm -nobdpos 

 

 gives the "LVCompare was called with incorrect parameters" error message.

However: 

%1 %2 -nobdcosm -nobdpos -nofppos

 works fine.

 

 

 

I don't understand why this happens....   but at least it's working for me now.  Smiley Happy

0 Kudos
Message 9 of 10
(5,088 Views)

 Many thanks Anthony!!!!!

I have gone through a bit of a nightmare to set this, since nothing that I had tried seemed to work until I read your "trick" of swapping the attribute order. Bang, it worked straight away but as you, no idea why this could be!

 

%1 %2 -nobdcosm -nobdpos -nofppos

Those work!

 

Thanks very much. 



0 Kudos
Message 10 of 10
(4,688 Views)