Example Code

Passing Custom Command Line Arguments to a TestStand Operator Interface (LabVIEW)

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • Teststand

Code and Documents

Attachment

Description

Overview

The TestStand Application Manager supports processing custom command line arguments through the ProcessUserCommandLineArguments event. This can prove useful when automating test execution from a CI server.

Description

 

 This example is similar to the LabVIEW Basic User Interface, but has been modified to accept the following command line arguments:

Option Purpose
/SimulateFailure <failures> When used with the included example sequence file, this suppresses the simulation dialog and instead simulate failures as specified. This argument accepts the following parameters:
  • Keyboard
  • Video
  • Power
  • CPU
  • ROM
  • RAM
If no parameters are specified, then all components are simulated to pass.

 

This example demonstrates the following concepts:

  • Using ProcessUserCommandLineArgumentsEvent to handle custom command line arguments.
  • Use of the ApplicationMgr.AddCommandLineArgumentsHelp function to add custom command line arguments help.
  • Creating a custom UI Message handler to pass command line arguments to sequence execution.

Note: This example does not pass errors back to the command line, so it may generate popups that require user action.

Hardware and Software Requirements

TestStand 2014 SP1 or higher 

LabVIEW 2015 SP1 or higher

Steps to Implement or Execute Code

 

  1.  Unzip the attached code and build the TestExec.exe build spec from the Basic User Interface project.
  2. Open a command line window in the Build directory (Shift + right click » Open command window here)
  3. In order to see the Command Line help, run:

    TestExec /?

  4. Experiment with the /SimulateFailure argument. For example:

    TestExec /runEntryPoint "Single Pass" "<ExampleDir>\TestSequence\Computer Motherboard Test Sequence.seq" /SimulateFailure Keyboard Video RAM /quit

https://www.linkedin.com/in/trentweaver

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.