Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Tutorial
NI Supported: Yes
Publish Date: Sep 6, 2006


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links - Products and Services

Understanding and Modifying Result Collection

2 ratings | 5.00 out of 5
Print

Overview

TestStand automatically collects results from the tests it executes. TestStand uses the result information to generate reports, update displays, and log test information to databases. TestStand’s flexible architecture enables you to specify the type of data TestStand collects from each step. This document describes how TestStand collects results and how you can customize the information collected.


Default Result Collection

TestStand automatically collects the results of each step. You can disable result collection for an individual step on the Run Options tab of the Step Properties dialog box. You can disable result collection for an entire sequence in the Sequence Properties dialog box. You can completely disable result collection on your computer in the Station Options dialog box.

Each sequence has a local variable called ResultList that is initially an empty array of container properties, as shown below.


[+] Enlarge Image



TestStand appends a new container property to the end of the ResultList array before a step executes. This container property is called the step result. After the step executes, TestStand automatically copies the contents of the Result subproperty for the step into the container property, step result. In the figure below, notice how the ResultList is populated when execution suspends at a breakpoint. Each element of the array is a separate step result.


[+] Enlarge Image




Each step type can define different contents for its Result subproperty. In the figure below, notice the differences between the Result subproperty of the Pass/Fail test and the Numeric Limit test.


[+] Enlarge Image


TestStand can append Result properties from different step types to the same ResultList array. When TestStand copies the Result property for a step to its step result, it also adds information such as the name of the step and its position in the sequence.

If a step calls a subsequence or generates a call to a callback sequence, TestStand creates a special result subproperty to store the result of the subsequence. For subsequence calls, TestStand adds the ResultList array variable from the subsequence.

Refer to the Result Collection section in Chapter 3, Executions, of the TestStand Reference Manual for more information on how TestStand collects results.

Note: All steps in the default process model, with the exception of the call to the MainSequence Callback, do not record results. If you add steps to the process model, you should disable Result Recording for each step you create. When the default process model calls the TestReportCallback, it passes Locals.ResultList[0]. Because no other step in the model generates results, ResultList[0] always contains the results from the call to the MainSequence.

Adding Data to the ResultList


The following four techniques explain how you can add data to the ResultList.

· By default, all step types have a ReportText subproperty. Step.Result.ReportText contains a message string that TestStand includes in the report. You can set the value of the message string directly in a code module. The C/CVI and LabVIEW module adapters also allow code modules to set this property by modifying the corresponding member of the test data structure or cluster. Refer to Chapter 5, Module Adapters, of the TestStand Reference Manual for more information on the property assignments that the module adapters automatically perform to and from step properties.

You can also set the value of the message in a TestStand expression. The Post Expression of a Statement step type is shown in the figure below followed by the report for the sequence.





[+] Enlarge Image


Notice that Limits.Low, Limits.High, and Comp are not subproperties of the Result property. Thus, TestStand does not automatically include them in the ResultList. However, depending on the report options you configure, these subproperties are included in the report.

The default process model uses the TestStand ActiveX API to include these properties in the step results for steps that contain them. The model calls the AddExtraResult API method to specify additional step properties that TestStand copies to the result list after it executes each step. You can call this method to specify additional step properties for TestStand to include in the result list. You can add any number of extra results by calling this method repeatedly.

In the Figure below, the steps Include Limits in Results and Include Comparison Type in Results from the default process model call the AddExtraResult method.


[+] Enlarge Image

· A code module can use the API to insert subproperties directly into the ResultList. Refer to the Modify Report example located at the link below.
· TestStand always copies each subproperty within the Result property of each step to the result list. Refer to the Modify Report example located at the link below for more information.
a. You can create custom step types, adding subproperties to the Result property of the step type.
b. You can use the TestStand ActiveX API to dynamically add subproperties to the Result property of a step. The methods of the PropertyObjectClass have an Option parameter. Set the option parameter toPropOption_InsertIfMissing to create a new property if the property specified by the lookupString does not exist. PropOption_InsertIfMissing has a value of 1.
See Also:
Modifying Report Collection Example

2 ratings | 5.00 out of 5
Print

Reader Comments | Submit a comment »

More TestResult Description Required
From you User Manual, Reference Manual, and the website help, I can't figure out which variables are responsible for setting the value of: 1. The MainSequence test result. (This should be a combination of each steps result) 2. The banner test result which is responsible for putting a green checkmark or a red ‘x’ on the execution tab on the LHS. 3. The “UUT Result” field in the report. It’s at the beginning of the report.
- Michael Leitch, Tantalus. mleitch@tantalus.com - Oct 18, 2008

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).