Table Of Contents

Using NI Compare with Source Control Providers

Last Modified: January 24, 2019

A source control provider is a piece of third-party software that enables you to share files among multiple users, improve security and quality, and track changes to shared projects. You can use NI Compare to display the differences between the local copy of a selected file and the version in source control.

Before beginning this task, make sure the computer on which you are running NI Compare includes a source control provider.

Complete the following steps to configure a source control provider to use NI Compare as the default application to compare two versions of a file:

  1. Direct the source control provider to nicompare.exe. By default, nicompare.exe is installed in C:\Program Files\National Instruments\[Product].
  2. Enter arguments in the source control provider to configure nicompare.exe to perform different operations. The following table lists available arguments.
    Argument Description
    -alias1 Changes the display name of the first file. You may consider changing the display name of the file if the filename is randomly generated. Specifying a meaningful display name helps you to keep track of the version of the file.
    -alias2 Changes the display name of the second file. You may consider changing the display name of the file if the filename is randomly generated. Specifying a meaningful display name helps you to keep track of the version of the file.
    -exclude Specifies the type of difference to ignore. Use commas to separate multiple types of differences.
    -report Generates a comparison report in HTML format that summarizes the differences.
    -usePreferences

    Specifies whether to use the default settings in NI Compare.

    The value for this argument can be only TRUE or FALSE. Specify a value of TRUE if you want to use user-defined settings. You can specify user-defined settings by selecting File»Preferences in NI Compare. Specify a value of FALSE if you want to use the default settings.

    spd-note-note
    Note  

    NI Compare does not have user-defined settings for project comparison.

    If you do not use this argument, NI Compare uses the default settings.

    For example, you can use the following command to configure the source control provider to use NI Compare.

    "C:\Program Files\National Instruments\LabVIEW NXG\nicompare.exe" $1 $2 -alias1 TestFile -usePreferences true -exclude Diagram.Comments,Diagram.Visual.Position -report "C:\Users\lvadmin\Desktop\compare report.html"

    where

    • $1 and $2 are variables the source control provider defines for the paths to the files you want to compare.
    • -alias1 TestFile changes the display name of the first file to TestFile.
    • -usePreferences true uses user-defined settings in NI Compare.
    • -exclude Diagram.Comments,Diagram.Visual.Position configures NI Compare to not detect or display differences of comments on the diagram and node positions on the diagram.
    • -report "C:\Users\lvadmin\Desktop\compare report.html" generates an HTML comparison report and saves the report to C:\Users\lvadmin\Desktop.
  3. (Optional) Complete any remaining steps to configure the source control provider. For example, some source control providers allow you to specify comparison tools for particular file extensions. You can specify nicompare.exe for files with the .gvi, .gcdl, and .lvproject extensions. Consult the documentation for the source control provider for more configuration information.

Recently Viewed Topics