Log Test Results to Databases with TestStand

Updated Aug 27, 2020

Environment

Software

  • TestStand

Operating System

  • Windows

This tutorial introduces database logging using TestStand. Although a test report does a great job of providing a snapshot of the passes and failures of a test run, it isn’t convenient when you want to poll historical test results from one or many test stations. This tutorial shows how NI TestStand can quickly log test results to your database out of the box.

Although NI TestStand can communicate with almost any open database connectivity (ODBC) system such as Oracle, SQL Server, or MySQL, it is also shipped with a Microsoft Access database so you don’t have to change any other default settings to start logging data.

For this tutorial, you will use one of the shipping examples included in the NI TestStand installation. However, you can perform this tutorial with any sequence file that logs code module information.
 

  1. Open the Computer Motherboard Test shipping example from <TestStand Public>\ Examples\Demos\Computer Motherboard Test\LabVIEW\Computer Motherboard Test Sequence.seq. This shipping example shows a Computer Motherboard Test that includes simulated NI LabVIEW code modules for testing a computer’s power supply, CPU, ROM, RAM, video, and keyboard.
The sequence file will open and a dialog box will pop up. Click OK.
 
  1. Select Configure>>Results Processing… from the pull-down menu.
 
 
The Results Processing dialog box appears. The Results Processing dialog box is where you can enable or disable logging to a report, database, or offline file. Note that the ATML report output is enabled by default.
  1. Check the Enabled box for the Database output to enable default database logging. Click OK.
  1. Select Execute>>Single Pass from the pull-down menu to run the sequence file.
 

If you are using the Computer Motherboard Test example, a Motherboard Test Simulator dialog box will appear. This gives an operator the ability to simulate failing test outputs from several components.

For this example, check the Video and RAM options to simulate a failed unit under test (UUT). Click OK.

Once the sequence has executed, a full set of data is logged to the database for one UUT. At the conclusion of the sequence, NI TestStand shows the ATML report, which was enabled by default in the Result Processing dialog box.
 
  1. Select Configure>>Results Processing… from the pull-down menu to see the results logged to the database.
  2. Click on the Options… icon to the right of the Database Output.
 

The Database Options dialog box appears. The Database Options dialog box is where you can customize the logging of results to a database, such as on-the-fly logging, database schemas, table statements, and table organization.
 
In the Data Link Options section, you can select the type of database that will be used to store the data. For this tutorial, keep the Database Management System as Access.
  1.  Select View Data to launch the Database Viewer tool.
The Database Viewer application appears. The Database Viewer allows you to view data in a database, edit table information, and execute SQL commands.  
 
  1. Expand the Default configuration tree options to display the tables that make up this database scheme.  
 
  1. To view the logged data from the execution that was run, right-click on UUT_RESULT and select View Data.

The Results window displays the logged results for UUT_RESULT. You can enable different views to visualize the data. Grid View and Card View are shown below.
 
  1. Right-click on the STEP_RESULT table and select View Data to view the data for each step. In this case, you can find the failing results for the RAM and Video Tests and Diagnostics steps.
A screen shot of a computer  Description automatically generated