LabVIEW includes predefined command line operations to enable automation of tasks like compiling files, building applications, and running VIs.

  • MassCompile—Mass compiles the files in the specified directory.
  • ExecuteBuildSpec—Builds an application or a library using the settings in the specified build specification(s) and returns the path of the output files.
  • RunVI—Runs a VI with the predefined connector pane interface and returns the output or error information.
  • CloseLabVIEW—Closes LabVIEW without any prompts.
  • CreateComparisonReport—Generates a VI comparison report for two specified VIs.
  • RunVIAnalyzer—For VI Analyzer Toolkit. Runs the specified VI analyzer task in the LabVIEW VI Analyzer Toolkit and saves the test report to the specified location.
  • RunUnitTests—For Unit Test Framework Toolkit. Runs tests on the specified files in the LabVIEW Unit Test Framework Toolkit and saves the JUnit file to the specified location.
  • You can also create custom command line operations to run in LabVIEW.

    MassCompile

    Mass compiles the files in the specified directory.

    Table 5. MassCompile Arguments lists the available arguments of this operation.

    Table 5. MassCompile Arguments
    Argument Required or Optional Description Default
    -DirectoryToCompile Required Location of the VIs to compile.
    -MassCompileLogFile Optional File path of the log results. Path to the temporary location.
    -AppendToMassCompileLog Optional A Boolean that specifies whether to add the results to the log file. false: If the log file you specify already exists, LabVIEW overwrites the existing log file.
    -NumOfVIsToCache Optional Number of VIs allowed in memory during the mass compile.
    Note Caching VIs can significantly decrease the execution time of a mass compile because LabVIEW does not have to load cached VIs when you compile a top-level VI. However, VI caching consumes more system memory. If you mass compile a folder that contains VIs with the same name in different subfolders and the VIs do not belong to a library, VI caching may cause cross-linking.
    0
    -ReloadLVSBs Optional A Boolean that specifies whether to ignore CINs in VIs and allow the application to search for them.

    This argument is useful when a large number of CINs have been recompiled and need to be reloaded.

    false

    To run MassCompile in the CLI for LabVIEW, execute a command using the following syntax:

    LabVIEWCLI -OperationName MassCompile -DirectoryToCompile <directory of file(s)> -MassCompileLogFile <path to log file> -AppendToMassCompileLog <true or false> -NumOfVIsToCache <number of VIs to cache> -ReloadLVSBs <true or false>

    For example:

    LabVIEWCLI -OperationName MassCompile -DirectoryToCompile "C:\temp" -MassCompileLogFile "C:\temp\log.txt" -AppendToMassCompileLog true -NumOfVIsToCache 0 -ReloadLVSBs false

    ExecuteBuildSpec

    Builds an application or a library using the settings in the specified build specification(s) and returns the path of the output files.

    Table 6. ExecuteBuildSpec Arguments lists the available arguments of this operation.

    Table 6. ExecuteBuildSpec Arguments
    Argument Required or Optional Description Default
    -ProjectPath Required Path to the LabVIEW project .lvproj file that contains the build specification.
    -TargetName Optional Target that contains the build specification. My Computer
    -BuildSpecName Optional Name of the build specification that appears under Build Specifications in the Project Explorer window. Empty string: The CLI for LabVIEW builds all build specifications under the specified target.

    To run this operation in the CLI for LabVIEW, execute a command with the following syntax:

    LabVIEWCLI -OperationName ExecuteBuildSpec -ProjectPath <path to project> -TargetName <name of target> -BuildSpecName <name of build specification>

    For example:

    LabVIEWCLI -OperationName ExecuteBuildSpec -ProjectPath "C:\temp\test.lvproj" -TargetName "My Computer" -BuildSpecName "My DLL"

    RunVI

    Runs a VI with the following connector pane interface and returns the output or error information.

    LabVIEW VI connector pane with three terminals.

    Terminal Data Type Description

    LabVIEW VI connector pane first terminal callout.

    String control

    LabVIEW control terminal representing a string data type.

    Command line arguments for the VI.

    LabVIEW VI connector pane second terminal callout.

    32-bit signed indicator

    LabVIEW control terminal representing a 32-bit signed integer numeric data type.

    CLI for LabVIEW exit code that the VI returns.

    LabVIEW VI connector pane third terminal callout.

    String indicator

    LabVIEW control terminal representing a string data type.

    Output or error information to include in the CLI for LabVIEW console or log file.

    Table 7. RunVI Arguments lists the available arguments of this operation.

    Table 7. RunVI Arguments
    Argument Required or Optional Description Default
    -VIPath Required Path to the VI to run in LabVIEW. If the connector pane of the VI does not match the predefined interface, the CLI for LabVIEW returns an error.
    <Command line arguments for the VI> Optional Elements of the input array of the VI. Use spaces to separate elements.

    To run this operation in the CLI for LabVIEW, execute a command with the following syntax:

    LabVIEWCLI -OperationName RunVI -VIPath <VI path> <first element of array> <second element of array>...

    For example:

    LabVIEWCLI -OperationName RunVI -VIPath "C:\Users\inlabview.APAC\Documents\DemoProject\RunVI.vi" 101 202

    CloseLabVIEW

    Closes LabVIEW without any prompts.

    Note Any unsaved changes will be lost if a VI is open when you run this operation. Make sure you save all your changes before running this operation.

    This operation does not have any arguments.

    To run this operation in the CLI for LabVIEW, execute the following command:

    LabVIEWCLI -OperationName CloseLabVIEW

    CreateComparisonReport

    Compares two specified VIs and outputs an HTML, XML, Word, or text report containing the results of the comparison operation.

    Table 8. CreateComparisonReport Arguments lists the available arguments of this operation.
    Table 8. CreateComparisonReport Arguments
    Argument Required or Optional Description Default
    -vi1 Required Name or path of the first VI you are comparing.
    -vi2 Required Name or path of the second VI you are comparing.
    -reportType Optional Desired file type of the output report. This argument supports the following values:
    • HTML: produces an HTML format report with external images and style file.
    • HTMLSingleFile: produces an HTML form report with embedded images and style definition.
    • MicrosoftWord: produces a report in Microsoft Word format.
      Note Microsoft Word must be installed on your machine for this option to function.
    • PlainText: produces a report in plain text.
    • XML: produces a report in XML format with external images.

    If you do not specify this argument, it is inferred from the value provided for -reportPath.

    HTMLSingleFile
    -reportPath Required Name or path of the output report.
    -o Optional Overwrites existing reports and supporting files in the specified report directory if they exist.
    -c Optional Creates a new directory for the specified report path if it does not exist.
    -nofp Optional Excludes front panel differences from the comparison report.
    -nofppos Optional Excludes front panel position differences from the comparison report.
    -nobd Optional Excludes block diagram differences from the comparison report.
    -nobdcosm Optional Excludes block diagram cosmetic differences from the comparison report.
    -noattr Optional Excludes VI attribute differences from the comparison report.
    -d Optional Compares the specified VIs without including dependencies.

    To run this operation in the CLI for LabVIEW, execute a command with the following syntax:

    LabVIEWCLI -OperationName CreateComparisonReport -vi1 <name or path of first VI> -vi2 <name or path of second VI> -reportType <file type of report> -reportPath <name or path of output report>

    For example:

    LabVIEWCLI -OperationName CreateComparisonReport -vi1 "firstVI.vi" -vi2 "secondVI.vi" -reportType "HTMLSingleFile" -reportPath "report.html"

    RunVIAnalyzer

    Runs the specified VI analyzer task in the LabVIEW VI Analyzer Toolkit and saves the test report to the specified location.

    Table 9. RunVIAnalyzer Arguments lists the available arguments of this operation.

    Table 9. RunVIAnalyzer Arguments
    Argument Required or Optional Description Default
    -ConfigPath Required Path to the configuration file that contains VI Analyzer task settings to use in the analysis. You can use a configuration file you saved through the VI Analyzer or the VI Analyzer VIs. Alternatively, you can specify a VI, folder, or LLB to analyze. If you specify an item other than a configuration file, the VI runs all VI Analyzer tests on the specified item.
    -ReportPath Required Path to the report file.
    -ConfigPassword Optional Password of the configuration file, if any. Empty string
    -ReportSaveType Optional Format of the report or results file. The value for this argument must be one of the following:
    • ASCII
    • HTML
    • RSL File
    ASCII
    -ResultsPath Required Path to the results file. If the path is an empty string, LabVIEW ignores this argument.
    Note This argument is case sensitive.

    To run this operation in the CLI for LabVIEW, execute a command with the following syntax:

    LabVIEWCLI -OperationName RunVIAnalyzer -ConfigPath <path to configuration file> -ReportPath <path to report> -ReportSaveType <file type of report> -ConfigPassword <password of configuration file>

    For example:

    LabVIEWCLI -OperationName RunVIAnalyzer -ConfigPath "C:\temp\test.viancfg" -ReportPath "C:\temp\output.html" -ReportSaveType "HTML" -ConfigPassword "abc"

    RunUnitTests

    Runs tests on the specified files in the LabVIEW Unit Test Framework Toolkit and saves the JUnit file to the specified location.

    Note To run this operation, you must install the UTF JUnit Report library using the JKI VI Package Manager (VIPM) software.

    Table 10. RunUnitTests Arguments lists the available arguments of this operation.

    Table 10. RunUnitTests Arguments
    Argument Required or Optional Description Default
    -ProjectPath Required Path to the project file.
    -JUnitReportPath Required Path to the output JUnit file.

    To run this operation in the CLI for LabVIEW, execute a command with the following syntax:

    LabVIEWCLI -OperationName RunUnitTests -ProjectPath <path to project file> -JUnitReportPath <path to output JUnit file>
    For example:
    LabVIEWCLI -OperationName RunUnitTests -ProjectPath "C:\temp\test.lvproj" -JUnitReportPath "C:\temp\test.xml"