TestStand Tutorial
TestStand Tutorial
Testing a unit under test (UUT) requires more than just executing a set of
tests. The test management system must also perform a series of operations
before and after the test sequence executes to handle common test system
tasks, such as identifying the UUT, notifying the operator of pass/fail
status, generating a test report, and logging results. These operations define
the testing process, and the set of operations and the flow of execution is
called a process model.
1
Loading and Running Sequences
launch the sequence editor
A sequence file can contain any number of sequences along with sequence
file global variables, which you can use to share data among multiple
sequences within a sequence file. The sequence editor color codes
sequences by type, such as Execution entry points, Configuration entry
points, process model callbacks, subsequences, and engine callbacks.
The Steps pane for an individual sequence includes the Setup, Main, and
Cleanup step groups.
The steps in the Main step group typically perform UUT test
operations.
2
The steps in the Cleanup group execute after the steps in the
Main step group or when a sequence terminates. These steps typically
perform operations such as powering down or releasing handles to
instruments, fixtures, and UUTs.
A sequence can have parameters and any number of local variables. Use
parameters to pass and receive values between sequences. Use local
variables to hold values, maintain counts, hold intermediate values, and
perform any other type of local data storage within a sequence.
Use the Variables pane in the sequence editor to show and modify local
variables, parameters, sequence file global variables, and station global
variables. You can also use the Variables pane to show sequence context
and run state information when executing sequences. Refer to the Sequence
Context section of Chapter 3, Executions, of the NI TestStand Reference
Manual and to the NI TestStand Help for more information about the
sequence context.
3
Running a Sequence
When you run a sequence in the sequence editor, you initiate an execution.
You can run a sequence directly or run a sequence using a process model.
The process model sequence contains a series of steps that specify the
high-level flow of a sequence execution.
Click the Toggle Analyze File Before Executing button, shown at left,
on the Sequence Analyzer toolbar or select
Debug»Sequence Analyzer»Toggle Analyze File Before Executing
4
the execution completes, the Execution window dims and the Status
column of the RAM test contains the value Failed.
5
Running a Sequence Using the Sequential Process Model
In addition to executing sequences directly, you can execute sequences
using an Execution entry point, which is a sequence in a process model
sequence file that invokes a test sequence file.
Executing an Execution entry point performs a series of operations before and after calling
MainSequence of the sequence file. Common operations of the process
model include identifying the UUT, notifying the operator of pass/fail
status, generating a test report, and logging results.
The Single Pass Execution entry point executes the sequence once without
requiring a serial number and generates a report. Use the Single Pass
Execution entry point when you want to debug tests or determine whether
the sequence execution proceeds as you intended.
6
dialog box.
2. Click the Model tab, select SequentialModel.seq from the
Station Model ring control to select the Sequential model as
the default process model, and click OK.
3. Select Execute»Test UUTs. Before executing the steps in
MainSequence, the process model sequence launches a
UUT Information dialog box that requests a serial number. Enter
any number and click OK.
4. Use the options in the Test Simulator dialog box to select any test other
than the Video or CPU tests to fail. You can also allow all the tests of
the UUT to pass.
5. Click Done. Observe the Execution window as the sequence executes.
After completing the steps in MainSequence, the process model
shows a banner that indicates the result of the UUT.
6. Click OK to close the UUT Result banner. The process model
generates a report, which TestStand shows after testing all the UUTs,
and launches the UUT Information dialog box again.
7. Repeat steps 3 through 6 using several different serial numbers.
8. Click Stop in the UUT Information dialog box to stop the loop and
complete the execution. After the execution completes, TestStand
shows a full report on the Report pane of the Execution window for all
the tested UUTs.
9. Examine the test report that includes the results for each UUT and
close the Execution window.
Use the Batch model to specify that certain steps or groups of steps cannot
run on more than one UUT at a time or that certain steps must run on all
UUTs at the same time. The Batch model generates batch reports that
summarize the test results for all the UUTs in a batch.
7
serial number and UUT serial numbers for each test socket. You can
also disable test sockets in the UUT Information dialog box.
6. Enter any batch serial number and UUT serial numbers. Click Go.
Review the information in the Batch Model Example dialog box, then
click OK. TestStand launches several different front panels to indicate
the progress of the executions. Click OK to continue.
After completing the steps in MainSequence, the process model
shows a banner that indicates the result of the UUTs. You can view the
batch report and individual UUT reports or select to start the next
batch.
7. Click the View Batch Report button. From the pop-up list, you can
select Entire File to show all tested batches or Current Only to show
the most recently tested batch.
8. Select Current Only from the pop-up list. TestStand launches an
external viewer to show the reports. By default, XML and HTML
reports use Microsoft Internet Explorer, and text reports use Microsoft
Notepad. Enable Internet Explorer to run scripts if the browser
launches a prompt.
8
9
Editing Steps in a Sequence
You can:
o add a step to a sequence,
o specify a code module for a step,
o configure the properties of a step, and
o call a subsequence from a sequence.
The Insertion Palette contains a set of predefined step types you use to add
steps to sequences. Step types define the standard behavior and a set of step
properties for each step of that type. All steps of the same type have the
same properties, but the values of the properties can differ.
When you build sequence files, you can also use the Templates list in the
Insertion Palette. The Templates list acts as a clipboard of preconfigured
steps, variables, and sequences you commonly use. You can reuse the steps,
variables, and sequences as you develop sequence files.
Refer to Chapter 4, Built-In Step Types, of the NI TestStand Reference
Manual for more information about TestStand step types.
TestStand does not need the source code to invoke a DLL code module. Instead,
TestStand uses module adapters to determine the type of code module, how to
call the code module, the list of parameters the code module requires, and how
to pass parameters to the code module.
10
When you insert a step in a sequence, TestStand assigns the adapter
you selected from the Insertion Palette to the step. The icon for the step
reflects the adapter you selected. When you select <None> as the
adapter and then insert a step, the new step does not call a code module.
Use the General panel on the Properties tab of the Step Settings pane
to change the associated adapter after you insert the step.
4. On the Insertion Palette, select Tests»Pass/Fail Test and drag the step
below the RAM step on the Steps pane to add a Pass/Fail Test step. You
can also select the RAM step and double-click the step on the Insertion
Palette to add it, or you can right-click the RAM step and select Insert
Step from the context menu to add a step. By default, the name of the
new test is Pass/Fail Test.
Use a Pass/Fail Test step to call a code module that makes a pass/fail
determination. After the code module executes, the Pass/Fail Test step
evaluates a Boolean expression to determine whether the step passed
or failed.
5. Rename the step Video Test. Select the name on the Steps pane and
enter the new name, select the step on the Steps pane and press the
<F2> key, or change the Name field on the Properties tab of the Step
Settings pane of the Pass/Fail Test step to rename the step.
11
Specifying the Code Module
A code module is a program module, such as a Microsoft Windows DLL
or LabVIEW VI (.vi), that contains one or more functions that perform a
specific test or other action.
1. Select the Video Test step and click the Module tab of the Step
Settings pane. You can also right-click the Video Test step and select
Specify Module from the context menu to show the Module tab of the
Step Settings pane.
12
3. Select VideoTest from the Function ring control. TestStand uses
the prototype information stored in the type library or the exported
information of the DLL to populate the Parameters Table control.
4. In the Value Expression column of the result parameter, enter
Step.Result.PassFail or click the Expression Browser button,
13
Configuring Step Properties (3-3)
Each step in a sequence contains properties. The step type determines the
property set. All steps have a common set of properties that determine
the following attributes:
4. Click Post Actions on the Properties tab of the Step Settings pane to
show the Post Actions panel, on which you can specify what type of
action occurs after the step executes. You can make the action
conditional on the Pass/Fail status of the step or on any custom
condition expression.
For custom conditions, you can enable the Use Custom Condition
option, enter a custom condition expression that evaluates to True or
False, and select the appropriate actions from the On Condition True
and On Condition False ring controls.
6. Click Looping on the Properties tab of the Step Settings pane to show
the Looping panel, on which you can configure an individual step to
run repeatedly in a loop when the step executes. Use the Loop Type
ring control on the Looping panel to select the type of looping for the
step. TestStand determines the final status of the step based on the
14
number of passes, failures, or loop iterations that occur.
8. Confirm that the Settings column on the Steps pane of the Sequence
File window shows that the Video Test step contains Loop,
Precondition, and Post Action settings. Use the tooltip in the Settings
column to verify the values for each setting.
10. Select Execute»Single Pass to run the sequence. Select the Video test
to fail. The sequence immediately terminates after calling the
Video Test step 10 times in a loop. TestStand records the result of each
loop iteration in the report.
15
Calling a Subsequence from a Sequence
Use a Sequence Call step to call another sequence within the calling
sequence file or from a separate sequence file.
1. Insert a Sequence Call step after the Power On step on the Steps pane
and rename the step CPU Test.
2. On the Module tab of the Step Settings pane for the CPU Test step,
click the Browse button located to the right of the File Pathname
control and select <TestStand Public>\Tutorial\CPU.seq to
specify the sequence the step invokes.
5. Double-click the CPU Test step or right-click the step and select
Open Sequence from the context menu to open the sequence and show
the MainSequence of CPU.seq in the Sequence File window.
7. Close the Execution window and the CPU.seq Sequence File window.
9. Select a test to fail and click Done. After the sequence executes,
examine the test report. TestStand logs the results of the steps in the
subsequence in addition to the steps from the parent sequence.
16
17
18
19