Developing Test Programs Using TestStand Exercise Guide PDF
Developing Test Programs Using TestStand Exercise Guide PDF
Programs Using
TestStand TM
Exercise Guide
Course Software Version 2017 Service Pack 1 (SP1)
2019 Edition
Part Number 378189A-01
Copyright
© 2015 National Instruments. All rights reserved.
Under the copyright laws, this publication may not be reproduced or transmitted in any form,
electronic or mechanical, including photocopying, recording, storing in an information retrieval
system, or translating, in whole or in part, without the prior written consent of National
Instruments Corporation.
National Instruments respects the intellectual property of others, and we ask our users to do the
same. NI software is protected by copyright and other intellectual property laws. Where NI
software may be used to reproduce software or other materials belonging to others, you may
use NI software only to reproduce materials that you may reproduce in accordance with the
terms of any applicable license or other legal restriction.
Patents
For patents covering National Instruments products/technology, refer to the appropriate
location: Help»Patents in your software, the patents.txt file on your media, or the National
Instruments Patent Notice at ni.com/patents.
Cover Photo
Photo courtesy: NASA
Worldwide Offices
Visit ni.com/niglobal to access the branch office websites, which provide up-to-date contact
information, support phone numbers, email addresses, and current events.
For further support information, refer to the Additional Information and Resources appendix.
To comment on National Instruments documentation, refer to the National Instruments website
at ni.com/info and enter the Info Code feedback.
Table of Contents
Student Guide
A. Course Description............................................................................... 7
B. Course Goal ........................................................................................ 7
C. What You Need to Get Started .............................................................. 7
D. File Locations ...................................................................................... 8
E. Course Project Exercise Setup ............................................................... 8
F. Course Learning Map............................................................................ 10
Lesson 1
What Is TestStand?
Activity Test Executive Requirements Brainstorm............................... 1-2
Lesson 2
Creating Test Sequences
Activity Gathering Test Requirements .............................................. 2-2
Activity Define Test Cases.............................................................. 2-2
Exercise 2-1 Create a Test Sequence...................................................... 2-3
Activity Implement Test Code ......................................................... 2-7
Exercise 2-2 (LabVIEW) Call a Code Module ............................................ 2-8
Exercise 2-2 (LabWindows/CVI) Call a Code Module ................................. 2-21
Exercise 2-2 (TestStand Only) Call a Code Module ................................... 2-33
Lesson 3
Controlling TestStand Execution
Exercise 3-1 (LabVIEW) Create and Use a Local Variable ........................... 3-2
Exercise 3-1 (LabWindows/CVI) Create and Use a Local Variable ............... 3-9
Exercise 3-1 (TestStand Only) Create and Use a Local Variable .................. 3-15
Exercise 3-2 Modify the Post Action Property of a Step ............................ 3-20
Lesson 4
Troubleshooting Test Sequences
Exercise 4-1 (LabVIEW) Troubleshoot a Code Module Error........................ 4-2
Exercise 4-1 (LabWindows/CVI) Troubleshoot a Code Module Error ............ 4-7
Exercise 4-1 (TestStand Only) Troubleshoot Test Sequence Errors ............. 4-13
© National Instruments | 1
Table of Contents
Lesson 5
Reusing Code in a Sequence
Exercise 5-1 (LabVIEW) Create and Use a Subsequence ............................ 5-2
Exercise 5-1 (LabWindows/CVI) Create and Use a Subsequence................. 5-14
Exercise 5-1 (TestStand Only) Create and Use a Subsequence ................... 5-28
Exercise 5-2 Create and Use a Global Variable ......................................... 5-40
Exercise 5-3 (LabVIEW) Create and Use a Custom Data Type .................... 5-43
Exercise 5-3 (LabWindows/CVI) Create and Use a Custom Data Type ......... 5-59
Exercise 5-3 (TestStand Only) Create and Use a Custom Data Type ........... 5-74
Exercise 5-4 Export and Import Properties ............................................... 5-88
Lesson 6
Storing and Presenting Test Results
Activity Generate a Default Report................................................... 6-2
Exercise 6-1 Configure Results Collection................................................ 6-3
Exercise 6-2 Configure Report Path Settings ............................................ 6-7
Exercise 6-3 Log Additional Results ........................................................ 6-13
Exercise 6-4 Log Results to a Database................................................... 6-18
Lesson 7
Executing a Test Sequence For Multiple UUTs
Exercise 7-1 Customize Serial Number Entry............................................ 7-2
Exercise 7-2 Execute Steps When the Sequence File Loads ....................... 7-6
Lesson 8
Executing Tests in Parallel
Activity What problems can arise from serial testing? ......................... 8-2
Exercise 8-1 Execute a Step Asynchronously ........................................... 8-3
Exercise 8-2 (LabVIEW) Execute Tests in Parallel...................................... 8-8
Exercise 8-2 (LabWindows/CVI) Execute Tests in Parallel .......................... 8-19
Exercise 8-2 (TestStand Only) Execute Tests in Parallel............................. 8-30
Lesson 9
Deploying a Test Sequence
Activity Additional Deployment Considerations .................................. 9-2
Activity Select the Appropriate Deployment Approach........................ 9-2
Exercise 9-1 Deploy a Test System ........................................................ 9-3
Lesson 10
Using LabVIEW Code Modules with TestStand
Exercise 10-1 Using LabVIEW Project ....................................................... 10-2
Appendix A
Solar Panel Testing Requirements
A. Test Requirements ............................................................................... A-2
B. Solar Panel Output ............................................................................... A-2
C. Power Output - DC............................................................................... A-3
D. Power Output - AC .............................................................................. A-3
E. System Diagram .................................................................................. A-3
2 | ni.com
Developing Test Programs Using TestStand
Appendix B
Open-Ended Exercises
A. Power Test ......................................................................................... B-2
B. Guessing Game ................................................................................... B-3
C. Message Popup Batch Synchronization ................................................... B-4
Appendix C
Additional Information and Resources
© National Instruments | 3
Student Guide
Topics
+ Course Description
+ Course Goal
+ What You Need to Get Started
+ File Locations
+ Course Project Exercise Setup
+ Course Learning Map
Student Guide
A. Course Description
The Developing Test Programs Using TestStand course teaches you how to navigate
the TestStand software design environment and use different design languages to
quickly create test applications.
This course assumes that you are familiar with Windows and that you have experience
writing algorithms in the form of flowcharts or block diagrams.
This course is also part of the NI Badge program. The NI Badge program helps you
find learning resources and gain skills related to your projects. Track your
knowledge growth with milestone badge assessments and professional
certifications. Go to ni.com to test your understanding of engineering fundamentals
and best practices using NI products with these free online assessments.
B. Course Goal
This course prepares you to use existing TestStand features and best practices to
create and deploy test sequences as a complete test system.
• Every built-in function, or object; refer to the TestStand Help for more information
about features not described in this course.
• Developing a complete application for any student in the class; refer to the
examples and project templates in the TestStand directory you can use and
incorporate into applications you create.
D. File Locations
After extracting the exercise and solutions folders, we recommend placing them in the
Local Disk (C:).
6 | ni.com
Developing Test Programs Using TestStand
© National Instruments | 7
Student Guide
8 | ni.com
1 What Is
TestStand?
Activities
+ Test Executive Requirements Brainstorm
Lesson 1 What Is TestStand?
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
1-2 | ni.com
2 Creating Test
Sequences
Activities
+ Gathering Test Requirements
+ Define Test Cases
+ Implement Test Code
Exercises
Exercise 2-1 Create a Test Sequence
Exercise 2-2 (LabVIEW) Call a Code Module
Exercise 2-2 (LabWindows/CVI) Call a Code Module
Exercise 2-2 (TestStand Only) Call a Code Module
Lesson 2 Creating Test Sequences
For this activity, list only high-level requirements such as hardware, software, and
types of tests.
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
2-2 | ni.com
Developing Test Programs Using TestStand
Scenario
The first step in testing a solar panel and controller is to visually inspect the UUT for
defects.
In this exercise, create a test sequence that begins by displaying a message box to
prompt the operator to inspect the UUT.
Requirements
The solar panel and controller shall have no visible defects as determined by a test
operator.
Implementation
1. Launch the TestStand Sequence Editor and click OK to dismiss the Login dialog
box.
Note If Compatibility dialog box appears enable the Don’t Show this Dialog
Box Again option and click OK to dismiss it.
2. Select File»Save Sequence File and save the sequence file as Solar Panel
Test.seq in the:
3. Double-click Message Popup in the Insertion Palette to add a new message popup
step to the Main step group, as shown below.
2-4 | ni.com
Developing Test Programs Using TestStand
3 4
Test
1. Select Execute»Run MainSequence to execute the sequence.
1 The list bar control and the MainSequence tab display a passing icon with a green
checkmark.
2 The Status column displays Done after the execution has finished.
2-6 | ni.com
Developing Test Programs Using TestStand
Scenario
You need to make sure that the solar panel controller does not overheat while testing
the solar panels under maximum voltage. In addition, you want to abort testing on
solar panels that do not have the proper resistance.
In this exercise, you create actions and tests and call them from the sequence. The
two numeric limit test steps are described below:
• A resistance test to verify that the resistance across the solar panel, as read by
the controller, falls within a normal range.
• A thermal test to ensure that the solar panel controller does not overheat.
Note You create the code module for the thermal test in this exercise.
2-8 | ni.com
Developing Test Programs Using TestStand
Requirements
• The solar panel controller board temperature shall not exceed 62 degrees C.
• The resistance measured across the solar panel shall be between 110 to
118 Ohms.
Implementation
Note If you have not completed the previous exercise, please copy the
solution of the Exercise 2-1 to the appropriate location in the Exercises
folder.
Note Before completing this exercise you must install the Driver Simulation
API library.
To install the drivers, make sure that LabVIEW is not running and then navigate
to C:\Exercises\Developing Test Programs\Driver Simulation API
directory and run Setup.bat as administrator. The Setup.bat executable
installs the necessary components in the LabVIEW and LabWindows/CVI
directories.
2. Add a search directory to allow TestStand to find the Driver Simulation VIs.
b. Click Add.
d. Click OK. Observe that the directory is added to the search directories table.
2-10 | ni.com
Developing Test Programs Using TestStand
3. Select the LabVIEW adapter from the drop-down menu in the menu bar to create
steps configured to call a LabVIEW VI.
Note You can specify which LabVIEW server to use with TestStand by
configuring the LabVIEW adapter.
b. Click the Configure button to open the LabVIEW Adapter Configuration dialog
box.
4. Create three action steps in the Setup step group to initialize the digital multimeter
(DMM), power supply and test fixture according to the figure and table below.
2-12 | ni.com
Developing Test Programs Using TestStand
• Three action steps to initialize the DMM, power supply, and test fixture.
Note Do not execute these Setup step group steps before implementing
the Cleanup step group, since shut down steps will close the references that
you open in Setup. Similarly, if your sequence ever halts as a result of a
run-time error or closing the execution, do not abort execution, because that
will skip execution of the Cleanup step group.
5. Create two action steps in the Cleanup step group to shut down the power supply
and DMM according to the figure and table below.
2-14 | ni.com
Developing Test Programs Using TestStand
• Two action steps to shut down the power supply and DMM.
a. Insert a Numeric Limit Test step in the Main step group to test the resistance
of the solar panel.
2-16 | ni.com
Developing Test Programs Using TestStand
7. Create a numeric limit step to test the temperature of the solar panel controller
board.
b. Rename the step Controller Board Thermal Test and move it between the
Visual Inspection and Resistance Test.
Note Before we can configure the Controller Board Thermal Test step, we
need to create the code module that the test step calls.
8. Create a code module in LabVIEW to implement the Controller Board Thermal Test
step.
Tip Press <Ctrl-Space> to use the Quick Drop dialog box to locate the VIs
or find them on the Instrument I/O»Instrument Drivers»Instrument
Simulation palette.
1 4 2 4 3
c. Configure the input and output terminals of the VIs as shown in the following
table.
SetEnvironment VI
Generate Voltage - DC VI
1 Set the input voltage on pin 0. Wire a 0 constant to the Channel input.
For simplicity, the hardware simulation layer assumes a 1:1 mapping of hardware
channels to pins on the UUT. For example, Channel 0 on the power supply is
connected to pin 0 on the UUT.
2 Create a control for the Power Supply in input terminal. Right-click the input
terminal and select Create»Control from the shortcut menu.
3 Create a control for the Output Voltage input terminal. Rename the control Line
in Voltage.
Read Temperature VI
1
2
2-18 | ni.com
Developing Test Programs Using TestStand
9. Configure the Controller Board Thermal Test as outlined in the following table.
Test
1. Test a passing UUT:
b. Ensure the initialize and close steps in the setup and cleanup groups complete
with the Done status.
a. In the Initialize Test Fixture step, change the Serial Number to "AllFail". This
serial number fails all tests except the Thermal Test.
b. Run the test again, and ensure that the Resistance Test now fails.
2-20 | ni.com
Developing Test Programs Using TestStand
Scenario
You need to make sure that the solar panel controller does not overheat while testing
the solar panels under maximum voltage. In addition, you want to abort testing on
solar panels that do not have the proper resistance.
In this exercise, you create actions and tests and call them from the sequence. The
two numeric limit test steps are described below:
• A resistance test to verify that the resistance across the solar panel, as read by
the controller, falls within a normal range.
• A thermal test to ensure that the solar panel controller does not overheat.
Note You create the code module for the thermal test in this exercise.
Requirements
• The solar panel controller board temperature shall not exceed 62 degrees C.
• The resistance measured across the solar panel shall be between 110 to
118 Ohms.
Implementation
Note f you have not completed the previous exercise, please copy the
solution of the Exercise 2-1 to the appropriate location in the Exercises
folder.
2-22 | ni.com
Developing Test Programs Using TestStand
Note Skip the following step if you have already completed the Exercise
2-2 for LabVIEW.
To install the drivers, make sure that LabVIEW is not running and then navigate
to C:\Exercises\Developing Test Programs\Driver Simulation API
directory and run Setup.bat as administrator. The Setup.bat executable
installs the necessary components in the LabVIEW and LabWindows/CVI
directories.
2. Add a search directory to allow TestStand to find the driver simulation DLL.
b. Click Add.
c. Browse to the <instr> directory for CVI. For example the shared directory
might be located at C:\Program Files(x86)\National Instruments\Shared\
CVI directory.
d. Click OK. Observe that the directory is added to the search directories table
3. Select the LabWindows/CVI adapter from the drop-down menu in the menu bar to
create steps configured to call a CVI DLL.
2-24 | ni.com
Developing Test Programs Using TestStand
4. Create three action steps in the Setup step group to initialize the digital multimeter
(DMM), power supply and test fixture according to the figure and tables below.
Note If you see a warning icon in the Description field, click the yellow
triangle and select Pointer from the dialog box.
Note Do not execute these Setup step group steps before implementing
the Cleanup step group, since shut down steps will close the references that
you open in Setup. Similarly, if your sequence ever halts as a result of a
run-time error or closing the execution, do not abort execution, because that
will skip execution of the Cleanup step group.
2-26 | ni.com
Developing Test Programs Using TestStand
5. Create two action steps in the Cleanup step group to shut down the power supply
and DMM according to the figure and table below.
a. Create a Numeric Limit Test step in the Main step group to test the resistance
of the solar panel.
2-28 | ni.com
Developing Test Programs Using TestStand
7. Create a numeric limit step to test the temperature of the controller board.
b. Rename the step Controller Board Thermal Test and move it between the
Visual Inspection and Resistance Test.
Note Before we can configure the Controller Board Thermal Test step, we
need to create the code module that the test step calls.
8. Create a code module in CVI to implement the Controller Board Thermal Test step.
2
3
Note The template generates a source file (.c) and a header file (.h).
c. Add the library and instrument files for the simulation driver.
• Right-click the project in the project pane and select Add Existing File.
• Right-click the project in the project pane and select Add Existing File.
d. Add a reference to the simulation driver in the SolarPanelTest header file and
declare a new function for the Controller Board thermal test.
• Double-click SolarPanelTest.h and edit the file based on the image below.
Note Output values can be implemented using the return value or using a
pointer (passing by reference). Passing by reference propagates any changes
made to the value back to the TestStand property you configure for that
parameter. For example, the step property Step.Result.Numeric can be
passed into the temperature variable function and it will be updated with the
step result when the function executes.
2-30 | ni.com
Developing Test Programs Using TestStand
• Save changes.
• Select Build»Build to create the DLL file. Verify in the status pane that no
errors occur while building.
g. Configure the Controller Board Thermal Test step to call the new DLL.
• In TestStand, select the Controller Board Thermal Test step and configure
the Module tab as follows.
h. Configure the test limits for the step in the Limits tab:
Test
1. Test a passing UUT.
b. Ensure that the Initialize and Shutdown steps in the Setup and Cleanup groups
complete with the Done status.
a. In the Initialize Test Fixture step, change the serial number to "AllFail". This
represents a known bad UUT.
b. Run the test again, and ensure that the Resistance Test now fails.
2-32 | ni.com
Developing Test Programs Using TestStand
Scenario
You need to make sure that the solar panel controller does not overheat while testing
the solar panels under maximum voltage. In addition, you want to abort testing on
solar panels that do not have the proper resistance.
In this exercise, you create actions and tests and call them from the sequence. The
two numeric limit test steps are described below:
• A resistance test to verify that the resistance across the solar panel, as read by
the controller, falls within a normal range.
• A thermal test to ensure that the solar panel controller does not overheat.
Requirements
• The solar panel controller board temperature shall not exceed 62 degrees C.
• The resistance measured across the solar panel shall be between 110 to
118 Ohms.
Implementation
Note If you have not completed the previous exercise, please copy the
solution of the Exercise 2-1 to the appropriate location in the Exercises
folder.
2-34 | ni.com
Developing Test Programs Using TestStand
Note Skip the following step, if you have already finished the Exercise 2-2
for LabVIEW or LabWindows/CVI.
To install the drivers, make sure that LabVIEW is not running and then navigate
to C:\Exercises\Developing Test Programs\Driver Simulation API
directory and run Setup.bat as administrator. The Setup.bat executable
installs the necessary components in the LabVIEW and LabWindows/CVI
directories.
2. Add a search directory to allow TestStand to find the Driver Simulation VIs.
b. Click Add.
d. Click OK. Observe that the directory is added to the search directories table.
3. Select the LabVIEW adapter from the drop-down menu in the menu bar to create
steps configured to call a LabVIEW VI.
Note You can specify which LabVIEW server to use with TestStand by
configuring the LabVIEW adapter.
b. Click the Configure button to open the LabVIEW Adapter Configuration dialog
box.
2-36 | ni.com
Developing Test Programs Using TestStand
4. Create three action steps in the Setup step group to initialize the digital multimeter
(DMM), power supply and test fixture according to the figure and table below.
• Three action steps to initialize the DMM, power supply, and test fixture.
Note Do not execute these Setup step group steps before implementing
the Cleanup step group, since shut down steps will close the references that
you open in Setup. Similarly, if your sequence ever halts as a result of a
run-time error or closing the execution, do not abort execution, because that
will skip execution of the Cleanup step group.
2-38 | ni.com
Developing Test Programs Using TestStand
5. Create two action steps in the Cleanup step group to shut down the power supply
and DMM according to the figure and table below.
a. Insert a Numeric Limit Test step in the Main step group to test the resistance
of the solar panel.
2-40 | ni.com
Developing Test Programs Using TestStand
7. Create a numeric limit step to test the temperature of the solar panel controller
board.
b. Rename the step Controller Board Thermal Test and move it between the
Visual Inspection and Resistance Test.
8. Configure the Controller Board Thermal Test as outlined in the following table.
2-42 | ni.com
Developing Test Programs Using TestStand
Test
1. Test a passing UUT:
b. Ensure the initialize and close steps in the setup and cleanup groups complete
with the Done status.
a. In the Initialize Test Fixture step, change the Serial Number to "AllFail". This
serial number fails all tests except the Thermal Test.
b. Run the test again, and ensure that the Resistance Test now fails.
Exercises
Exercise 3-1 (LabVIEW) Create and Use a Local Variable
Exercise 3-1 (LabWindows/CVI) Create and Use a Local Variable
Exercise 3-1 (TestStand Only) Create and Use a Local Variable
Exercise 3-2 Modify the Post Action Property of a Step
Lesson 3 Controlling TestStand Execution
Scenario
The USB output port of the system is regulated such that it always produces a
standard 5V. If the system cannot supply enough power to maintain this voltage, the
port outputs 0V. Create a test to ensure that the DC output is always maintained at
either 0V or 5V based on a supplied input voltage.
In this exercise you create steps to test the DC output voltage while the input voltage
varies from 0 – 9V.
Requirements
• The DC output (pin 2) shall output 5V ± .05 (1%) when the system voltage is 5V
or greater.
• The DC output shall output 0V ± .05 when the system voltage is below 5V.
Note The system voltage can be set for testing purposes by supplying
power to the battery terminal (pin 0).
Implementation
Note If you have not completed the previous exercise, please refer to the
Course Project Exercise Setup section of the Student Guide.
b. Place a Generate Voltage - DC VI, Configure VI, and the Read Voltage VI on
the block diagram of the Voltage Output Test VI.
1 4 2 4 3
1 Generate Voltage - DC—Generates the supply voltage for this test. This VI is
located on the Power Supply palette.
2 Configure—Configures the DMM to read either AC or DC voltage. Use the
Configure.vi from the DMM palette.
3 Read Voltage—Measures the voltage on the channel you specify. This VI is
located on the DMM palette.
4 Wire the error terminals to enforce execution order and propagate error
information.
3-2 | ni.com
Developing Test Programs Using TestStand
c. Configure the input and output terminals of the VIs as shown in the following
table.
Generate Voltage - DC VI
1 Set the input voltage on pin 0. Wire a 0 constant to the Channel input.
2 Create a control for the Power Supply in input terminal. Right-click the input
terminal and select Create»Control from the shortcut menu.
3 Create a control for the Output Voltage input terminal. Rename the control Line
in.
Configure VI
1 Create a control for the DMM in input terminal. Right-click the input terminal and
select Create»Control from the shortcut menu.
2 Specify the Signal Type. Right-click the input terminal and select Create»Constant
from the shortcut menu. Select DC from the pull-down menu.
Read Voltage VI
1 3
1 Wire the DMM out terminal of the Configure VI to the DMM in terminal of the Read
Voltage VI.
2 Wire a constant with a value of 2 to the Channel input.
According to the requirements document, the DC output is on channel 2.
3 Create an indicator for the Voltage output. Right-click the terminal and select
Create»Indicator. Rename the indicator Output Voltage.
2. In TestStand, add a loop to iterate over a range of input voltages. Each iteration of
the loop will test a different input condition.
a. Add a For loop step after the Resistance Test step.
Note TestStand automatically creates an End step when you create a For
step.
3-4 | ni.com
Developing Test Programs Using TestStand
b. Create a new local variable to store the value of the current input voltage
value.
3. Create a statement step to determine the expected voltage output of the test using
a TestStand expression and configure it as outlined in the following table.
3-6 | ni.com
Developing Test Programs Using TestStand
4. Create a numeric limit test within the For loop, after the statement step, to call the
Voltage Output Test code module.
Test
1. Test a passing UUT.
a. Verify that the Serial Number in the Initialize Test Fixture step is "Golden".
a. In the Initialize Test Fixture step, change the Serial number to "AllFail". This
serial number fails all tests except the Thermal Test.
3-8 | ni.com
Developing Test Programs Using TestStand
Scenario
The USB output port of the system is regulated such that it always produces a
standard 5V. If the system cannot supply enough power to maintain this voltage, the
port outputs 0V. Create a test to ensure that the DC output is always maintained at
either 0V or 5V based on a supplied input voltage.
In this exercise you create steps to test the DC output voltage while the input voltage
varies from 0 – 9V.
Requirements
• The DC output (pin 2) shall output 5V ± .05 (1%) when the system voltage is 5V
or greater.
• The DC output shall output 0V ± .05 when the system voltage is below 5V.
Note The system voltage can be set for testing purposes by supplying
power to the battery terminal (pin 0).
Implementation
Note If you have not completed the previous exercise, please refer to the
Course Project Exercise Setup section of the Student Guide.
2. In TestStand, add a loop to iterate over a range of input voltages. Each iteration of
the loop will test a different input condition.
a. Add a For loop step after the Resistance Test step.
Note TestStand automatically creates an End step when you create a For
step.
b. Create a new local variable to store the value of the current input voltage
value.
3-10 | ni.com
Developing Test Programs Using TestStand
c. Configure the For loop to iterate the new local variable from 0 – 9 with an
increment of 1.
3. Create a statement step to determine the expected voltage output of the test using
a TestStand expression.
a. Insert a Statement step within the For loop.
3-12 | ni.com
Developing Test Programs Using TestStand
4. Create a numeric limit test within the For loop, after the statement step, to call the
Voltage Output Test code module.
a. Right-click the statement step and insert a Numeric Limit Test step.
Test
1. Test a passing UUT.
a. Verify that the Serial Number in the Initialize Test Fixture step is "Golden".
a. In the Initialize Test Fixture step, change the Serial number to "AllFail". This
serial number fails all tests except the Thermal Test.
3-14 | ni.com
Developing Test Programs Using TestStand
Scenario
The USB output port of the system is regulated such that it always produces a
standard 5V. If the system cannot supply enough power to maintain this voltage, the
port outputs 0V. Create a test to ensure that the DC output is always maintained at
either 0V or 5V based on a supplied input voltage.
In this exercise you create steps to test the DC output voltage while the input voltage
varies from 0 – 9V.
Requirements
• The DC output (pin 2) shall output 5V ± .05 (1%) when the system voltage is 5V
or greater.
• The DC output shall output 0V ± .05 when the system voltage is below 5V.
Note The system voltage can be set for testing purposes by supplying
power to the battery terminal (pin 0).
Implementation
Note If you have not completed the previous exercise, please refer to the
Course Project Exercise Setup section of the Student Guide.
1. In TestStand, add a loop to iterate over a range of input voltages. Each iteration of
the loop will test a different input condition.
a. Add a For loop step after the Resistance Test step.
Note TestStand automatically creates an End step when you create a For
step.
b. Create a new local variable to store the value of the current input voltage
value.
3-16 | ni.com
Developing Test Programs Using TestStand
2. Create a statement step to determine the expected voltage output of the test using
a TestStand expression and configure it as outlined in the following table.
3. Create a numeric limit test within the For loop, after the statement step, to call the
Voltage Output Test code module.
3-18 | ni.com
Developing Test Programs Using TestStand
Test
1. Test a passing UUT.
a. Verify that the Serial Number in the Initialize Test Fixture step is "Golden".
a. In the Initialize Test Fixture step, change the Serial number to "AllFail". This
serial number fails all tests except the Thermal Test.
Scenario
In the case that something is critically wrong with the UUT, the test should be
terminated to prevent further damage to the UUT or the test fixture. Post actions can
be used to change the execution flow based on the results of a test. For the solar panel
test, failures on the visual inspection or thermal tests are critical, and should cause the
sequence to terminate.
In this exercise, you add a post action to the Controller Board Thermal Test to
terminate upon failure.
Requirements
• The test sequence shall immediately terminate if the UUT temperature exceeds
62 C.
• The test sequence shall immediately terminate if the UUT has visible defects.
Implementation
Note If you have not completed the previous exercise, please refer to the
Course Project Exercise Setup section of the Student Guide.
3-20 | ni.com
Developing Test Programs Using TestStand
c. Select Terminate execution in the On Fail drop-down menu to cause the step
to terminate execution upon failure.
Note Cleanup steps still execute even though the Post Action terminates
execution. Performing cleanup steps closes the hardware references and
prevents future run-time errors.
2. Add a post action to the Visual Inspection step, so that the testing terminates if a
user pressed the Cancel button.
c. Place a checkmark in the Use Custom Condition box because the post action
for this step is not determined by the step result.
d. Enter the following expression in the Use Custom Condition field to check if
the OK button was pressed.
Step.Result.ButtonHit == 1
The ButtonHit property is a specific property of the Message Popup step. The
ButtonHit property is a one-based index of the buttons on the message popup
windows.
ButtonHit
Button Clicked Value
Test
1. Test a passing UUT.
a. In the Initialize Test Fixture step, change the Serial number to "ThermalFail".
This represents a UUT that is expected to fail the thermal test.
3-22 | ni.com
4 Troubleshooting
Test Sequences
Exercises
Exercise 4-1 (LabVIEW) Troubleshoot a Code Module Error
Exercise 4-1 (LabWindows/CVI) Troubleshoot a Code Module Error
Exercise 4-1 (TestStand Only) Troubleshoot Test Sequence Errors
Lesson 4 Troubleshooting Test Sequences
Scenario
When creating test sequence files, it is a good idea to test often with a known good
unit, or with a simulation layer, to ensure that the test is working as expected. If steps
do not behave as expected, use TestStand debugging tools to narrow down the issue
to find the root cause of the problem.
In this exercise you use breakpoints and other tools in the Debug menu to investigate
a simulated motherboard UUT.
Implementation
1. Run the provided sequence file.
d. Notice that the Video Test and Keyboard Test steps fail.
4-2 | ni.com
Developing Test Programs Using TestStand
2. Set a breakpoint in the Keyboard Test step so you can step into it.
a. Click in the white space to the left of the Keyboard step to place a breakpoint.
c. Click the Step Over (F10) button to run only the Keyboard Test step, then
pause again.
3. In the Step Settings tab for the Keyboard Test step, investigate the parameter
values on the Module tab.
a. Notice that the Value for the Result property is not being stored. You must
update the parameter configuration to store the result.
Note You cannot make changes to the module parameters while the
sequence is executing.
c. After the sequence completes, display the Module tab of the Step Settings
window for the Keyboard Test step.
c. Select Execute»Run MainSequence to run the sequence again and verify that
the Keyboard Test step passes.
a. Click in the white space to the left of the Video Test step to place a breakpoint.
c. Click the Step Over button (F10) to run only the Video Test step, then pause
again.
4-4 | ni.com
Developing Test Programs Using TestStand
6. In the Step Settings tab for the Video Test step, investigate the parameter values
on the Module tab.
a. Notice that the Value for the Latency (µs) property is correctly set to
Step.Result.Numeric.
b. Click Step.Result.Numeric and hover the cursor over the Value field to view
the value.
c. Notice that the value is set to 0 by the code module. Because the value should
not be 0, you deduce that the problem is in the code module rather than the
step settings.
d. Click the Resume (F5) button to complete the execution. You must complete
the execution before you can debug the code module.
7. Run the sequence again and step into the code module.
a. Select Execute»Run MainSequence to run the sequence again.
e. When the breakpoint on the Video Test step is reached, click the Step Into
button (F8) to open the code module and debug it using LabVIEW.
a. Observe that the simulated value passed in is correct, but it is not propagating
to the output.
b. Display the block diagram and notice that the VideoValue control is not wired
to the Latency Indicator.
1 2
1 Notice the icon on the Run button is smaller than usual to indicate the VI is being
executed by an external application.
2 The Return to Caller button closes the VI and returns to TestStand.
a. Click the Resume (F5) button to complete the sequence execution so you can
edit the VI.
b. Right-click the Video Test step and select Edit Code from the shortcut menu.
Note You cannot open the VI directly from LabVIEW and edit it because
the VI is reserved by TestStand from running the sequence. To force
TestStand to release modules from memory, select File»Unload All Modules.
c. On the block diagram, wire the VideoValue control to the Latency Indicator.
Test
1. Remove all breakpoints from the sequence.
4-6 | ni.com
Developing Test Programs Using TestStand
Scenario
When creating test sequence files, it is a good idea to test often with a known good
unit, or with a simulation layer, to ensure that the test is working as expected. If steps
do not behave as expected, use TestStand debugging tools to narrow down the issue
to find the root cause of the problem.
In this exercise you use breakpoints and other tools in the Debug menu to investigate
a simulated motherboard UUT.
Implementation
1. Run the provided sequence file.
d. Notice that the Video Test and Keyboard Test steps fail.
2. Set a breakpoint in the Keyboard Test step so you can step into it.
a. Click in the white space to the left of the Keyboard step to place a breakpoint.
c. Click the Step Over button (F10) to run only the Keyboard Test step, then
pause again.
3. In the Step Settings tab for the Keyboard Test step, investigate the parameter
values on the Module tab.
a. Notice that the Value for the Measurement property is not being stored. You
must update the parameter configuration to store the result in
Step.Result.Numeric.
Note You cannot make changes to the module parameters while the
sequence is executing.
4-8 | ni.com
Developing Test Programs Using TestStand
c. After the sequence completes, display the Module tab of the Step Settings
window for the Keyboard Test step.
c. Select Execute»Run MainSequence to run the sequence again and verify that
the Keyboard Test step passes.
a. Click in the white space to the left of the Video Test step to place a breakpoint.
c. Click the Step Over button (F10) to run only the Video Test step, then pause
again.
6. In the Step Settings tab for the Video Test step, investigate the parameter values
on the Module tab.
a. Notice that the Value for the Measurement property is correctly set to
Step.Result.Numeric.
b. Click Step.Result.Numeric and hover the cursor over the Value field to view
the value.
c. Notice that the value is set to 0 by the code module. Because the value should
not be 0, you deduce that the problem is in the code module rather than the
step settings.
7. Open the code module source code in LabWindows/CVI, and attach CVI to the
TestStand process.
b. Select the Video Test step, and select the Edit Code button.
b. When the breakpoint on the Video Test step is reached, click the Step Into
button (F8) to open the code module and debug it.
4-10 | ni.com
Developing Test Programs Using TestStand
e. Inspect the source code of the function to find why this value is not being set.
f. To fix this issue, the measurement value should be set to the VideoValue input.
Test
1. Remove all breakpoints from the sequence.
4-12 | ni.com
Developing Test Programs Using TestStand
Scenario
When creating test sequence files, it is a good idea to test often with a known good
unit, or with a simulation layer, to ensure that the test is working as expected. If steps
do not behave as expected, use TestStand debugging tools to narrow down the issue
to find the root cause of the problem.
In this exercise you use breakpoints and other tools in the Debug menu to investigate
a simulated motherboard UUT.
Implementation
1. Run the provided sequence file.
2. Set a breakpoint in the Keyboard Test step so you can step into it.
a. Click in the white space to the left of the Keyboard step to place a breakpoint.
c. Click the Step Over (F10) button to run only the Keyboard Test step, then
pause again.
4-14 | ni.com
Developing Test Programs Using TestStand
3. In the Step Settings tab for the Keyboard Test step, investigate the parameter
values on the Module tab.
a. Notice that the Value for the Result property is not being stored. You must
update the parameter configuration to store the result.
Note You cannot make changes to the module parameters while the
sequence is executing.
c. After the sequence completes, display the Module tab of the Step Settings
window for the Keyboard Test step.
Test
1. Remove the breakpoint from the sequence.
Exercises
Exercise 5-1 (LabVIEW) Create and Use a Subsequence
Exercise 5-1 (LabWindows/CVI) Create and Use a Subsequence
Exercise 5-1 (TestStand Only) Create and Use a Subsequence
Exercise 5-2 Create and Use a Global Variable
Exercise 5-3 (LabVIEW) Create and Use a Custom Data Type
Exercise 5-3 (LabWindows/CVI) Create and Use a Custom Data Type
Exercise 5-3 (TestStand Only) Create and Use a Custom Data Type
Exercise 5-4 Export and Import Properties
Lesson 5 Reusing Code in a Sequence
Scenario
The UUT AC output, like the DC output, is regulated to always provide 120V AC at
60 Hz, unless the system does not have enough power, in which case the output is 0.
In order to prevent duplication, create a subsequence which can complete both the AC
and DC tests.
In Exercise 3-1 you created steps to test the DC output voltage while the input voltage
varies from 0 – 9V. In this exercise, you move the DC Output Voltage test to a new
subsequence and add steps to test the AC output voltage while the input voltage
varies.
Requirements
• The AC output (pin 3) is 120V ± 1.2V (1%) RMS at 60 Hz ± .6 Hz (1%) when
the system voltage is 8V or greater.
Note The system voltage can be set for testing purposes by supplying
power to the battery terminal (pin 0).
Implementation
Note If you have not completed the previous exercise, please refer to the
Course Project Exercise Setup section of the Student Guide.
1. Create a new subsequence in the Solar Panel Test sequence to implement the
power test.
a. In MainSequence select the For loop and all steps within it.
Tip Press the <Shift> key while clicking steps to select multiple steps.
5-2 | ni.com
Developing Test Programs Using TestStand
c. Rename the subsequence Power Output Test in the New Subsequence From
Selected Steps dialog box.
f. Verify that the local variables that the Voltage Test uses are moved to the
Power Output Test subsequence. Sequences cannot access local variables in
other sequences.
2. Add parameters to set values that are specific to the DC test and the AC test.
a. In the Power Output Test sequence, right click Parameters (‘Power Output
Test‘) and select Insert Parameter»Number.
1
2
5-4 | ni.com
Developing Test Programs Using TestStand
3. Update the expression of the Determine Expected Result step so that the
expression uses the OutputCutoff and TargetVoltage parameters instead of the
constant values that were used in Step 3, Exercise 3-1.
4. Change the tolerance for the Voltage Test measurement to be 1% of the target
voltage. You must change the tolerance to be a percentage because the expected
voltage is no longer a constant value. For example, the tolerance should be ±1.2V
for the AC test and ±.05V for the DC test.
b. On the Limits tab, replace the constant, 0.05, with the following expression.
Parameters.TargetVoltage *.01
5. Update the module that the Voltage Test step calls so that it supports both DC and
AC tests.
a. From the Module tab of the Voltage Test step, click the Edit VI button to open
the VI in LabVIEW.
1 2 3
1 Right-click the Signal Type constant and select Change to Control from the shortcut
menu. By using a control to specify signal type, you can set it from TestStand when the
test is run. Because a DC signal is an AC signal with an amplitude of 0, this configuration
allows the test to measure both AC and DC signals.
2 Right-click the Channel constant and select Change to Control from the shortcut menu.
Rename it DMM Channel. By using a control to specify the channel, you can set the pin
from TestStand when the test is run.
3 Add the DMM Channel and Signal Type controls to the connector pane of the VI and save
the VI.
c. In TestStand, select the Module tab and click the Reload VI Prototype button.
5-6 | ni.com
Developing Test Programs Using TestStand
6. Create a numeric limit test within the For loop, after the Voltage Test step, to call
the AC Output Frequency Test provided code module.
7. Add a precondition to the AC Frequency Test step so that the step executes only
if the expected frequency or voltage output is nonzero.
Note When the expected frequency is 0, then the signal is DC and you
don’t have to test it. If the expected voltage output is 0, then the system
does not have enough power to supply output voltage so you do not have
to test it.
a. Select the AC Frequency Test step and select Preconditions on the Properties
tab.
5-8 | ni.com
Developing Test Programs Using TestStand
c. In the Precondition Builder dialog box, build the expression to check the
expected voltage and target frequency.
2
1
1 Insert AllOf—Click to insert a new section where all conditions must be met.
2 Insert New Expression—Click and enter the following expression to determine if
the expected voltage is nonzero:
Locals.expectedVoltage != 0
3 Click the Insert New Expression button again to enter the following expression
that determines if the target frequency is nonzero:
Parameters.TargetFrequency != 0
d. Click OK and verify that the expression matches the following expression.
AllOf(Locals.expectedVoltage != 0, Parameters.TargetFrequency != 0)
8. Configure the Sequence Call step for the DC Power Output Test in the
MainSequence as outlined in the following table.
a. Verify the configuration of the DC Power Output Test sequence call as shown
in the following figure.
5-10 | ni.com
Developing Test Programs Using TestStand
10. Create action steps in the Setup and Cleanup groups of the MainSequence to
initialize and shut down the scope.
Note Shut down the scope before you shut down the power supply.
Test
1. Test a passing UUT.
a. In the Initialize Test Fixture step, verify that the Serial Number parameter is set
to "Golden".
c. Ensure that the Power Output Test subsequence runs twice: Once for the DC
test and once for the AC test.
5-12 | ni.com
Developing Test Programs Using TestStand
a. In the Initialize Test Fixture step, change the Serial Number parameter to
"AllFail". This serial number fails all tests except the thermal test.
b. Run the test again and ensure that the DC and AC tests both fail.
Scenario
The UUT AC output, like the DC output, is regulated to always provide 120V AC at
60 Hz, unless the system does not have enough power, in which case the output is 0.
In order to prevent duplication, create a subsequence which can complete both the AC
and DC tests.
In Exercise 3-1 you created steps to test the DC output voltage while the input voltage
varies from 0 – 9V. In this exercise, you move the DC Output Voltage test to a new
subsequence and add steps to test the AC output voltage while the input voltage
varies.
Requirements
• The AC output (pin 3) is 120V ± 1.2V (1%) RMS at 60 Hz ± .6 Hz (1%) when
the system voltage is 8V or greater.
Note The system voltage can be set for testing purposes by supplying
power to the battery terminal (pin 0).
Implementation
Note If you have not completed the previous exercise, please refer to the
Course Project Exercise Setup section of the Student Guide.
1. Create a new subsequence in the Solar Panel Test sequence to implement the
power test.
a. In MainSequence select the For loop and all steps within it.
Tip Press the <Shift> key while clicking steps to select multiple steps.
5-14 | ni.com
Developing Test Programs Using TestStand
c. Rename the subsequence Power Output Test in the New Subsequence From
Selected Steps dialog box.
f. Verify that the local variables that the Voltage Test uses are moved to the
Power Output Test subsequence. Sequences cannot access local variables in
other sequences.
2. Add parameters to set values that are specific to the DC test and the AC test.
a. In the Power Output Test sequence, right click Parameters (‘Power Output
Test‘) and select Insert Parameter»Number.
5-16 | ni.com
Developing Test Programs Using TestStand
3. Update the expression of the Determine Expected Result step so that the
expression uses the OutputCutoff and TargetVoltage parameters instead of the
constant values that were used in Step 3, Exercise 3-1.
4. Change the tolerance for the Voltage Test measurement to be 1% of the target
voltage. You must change the tolerance to be a percentage because the expected
voltage is no longer a constant value. For example, the tolerance should be ±1.2V
for the AC test and ±.05V for the DC test.
b. On the Limits tab, replace the constant, .05, with the following expression.
Parameters.TargetVoltage*.01.
5. Update the voltage output test code module in LabWindows/CVI to support the AC
and DC Output Frequency Test steps.
d. Change the constant channel value to the new variable DMMChannel in the
call to Sim_Dmm_ReadVoltage and change DCout result to ACout:
Sim_Dmm_ReadVoltage(dmm, DMMChannel, 0, ACout, errorInfo);
a. Select the Module tab and click the Reload Prototype button.
5-18 | ni.com
Developing Test Programs Using TestStand
11. When you are prompted to include analysis.h, click Yes to add this statement to
the top of the file.
13. Create an array local variable to contain the waveform data from the AC Test.
a. Right click on Locals (‘Power Output Test‘) and select Insert Local»Array of»
Number.
b. Set the Upper Bounds field to 999. This creates a 1000 element array.
5-20 | ni.com
Developing Test Programs Using TestStand
14. Create a numeric limit test within the For loop, after the Voltage Test step, to call
the AC Output Frequency Test code module you created.
Function: ACFrequencyTest
15. Add a precondition to the AC Frequency Test step so that the step executes only
if the expected frequency or voltage output is nonzero.
Note When the expected frequency is 0, then the signal is DC and you
don’t have to test it. If the expected voltage output is 0, then the system
does not have enough power to supply output voltage so you do not have
to test it.
a. Select the AC Frequency Test step and select Preconditions on the Properties
tab.
5-22 | ni.com
Developing Test Programs Using TestStand
c. In the Precondition Builder dialog box, build the expression to check the
expected voltage and target frequency.
2
1
1 Insert AllOf—Click to insert a new section where all conditions must be met.
2 Insert New Expression—Click and enter the following expression to determine if
the expected voltage is nonzero:
Locals.expectedVoltage != 0
3 Click the Insert New Expression button again to enter the following expression
that determines if the target frequency is nonzero:
Parameters.TargetFrequency != 0
d. Click OK and verify that the expression matches the following expression.
AllOf(Locals.expectedVoltage != 0, Parameters.TargetFrequency != 0)
16. Configure the Sequence Call step for the DC Power Output Test in the
MainSequence as outlined in the following table.
a. Verify the configuration of the DC Power Output Test sequence call as shown
in the following figure.
5-24 | ni.com
Developing Test Programs Using TestStand
18. Create action steps in MainSequence to initialize and shut down the scope.
Note Shut down the scope before you shut down the power supply.
Test
1. Test a passing UUT.
a. In the Initialize Test Fixture step, verify that the Serial Number parameter is set
to "Golden".
c. Ensure that the Power Output Test subsequence runs twice: Once for the DC
test and once for the AC test.
5-26 | ni.com
Developing Test Programs Using TestStand
a. In the Initialize Test Fixture step, change the Serial Number parameter to
"AllFail". This serial number fails all tests except the thermal test.
b. Run the test again and ensure that the DC and AC tests both fail.
Scenario
The UUT AC output, like the DC output, is regulated to always provide 120V AC at
60 Hz, unless the system does not have enough power, in which case the output is 0.
In order to prevent duplication, create a subsequence which can complete both the AC
and DC tests.
In Exercise 3-1 you created steps to test the DC output voltage while the input voltage
varies from 0 – 9V. In this exercise, you move the DC Output Voltage test to a new
subsequence and add steps to test the AC output voltage while the input voltage
varies.
Requirements
• The AC output (pin 3) is 120V ± 1.2V (1%) RMS at 60 Hz ± .6 Hz (1%) when
the system voltage is 8V or greater.
Note The system voltage can be set for testing purposes by supplying
power to the battery terminal (pin 0).
Implementation
Note If you have not completed the previous exercise, please refer to the
Course Project Exercise Setup section of the Student Guide.
1. Create a new subsequence in the Solar Panel Test sequence to implement the
power test.
a. In MainSequence select the For loop and all steps within it.
Tip Press the <Shift> key while clicking steps to select multiple steps.
5-28 | ni.com
Developing Test Programs Using TestStand
c. Rename the subsequence Power Output Test in the New Subsequence From
Selected Steps dialog.
f. Verify that the local variables that the Voltage Test uses are moved to the
Power Output Test subsequence. Sequences cannot access local variables in
other sequences.
2. Add parameters to set values that are specific to the DC test and the AC test.
a. In the Power Output Test sequence, right click Parameters (‘Power Output
Test‘) and select Insert Parameter»Number.
1
2
5-30 | ni.com
Developing Test Programs Using TestStand
3. Update the expression of the Determine Expected Result step so that the
expression uses the OutputCutoff and TargetVoltage parameters instead of the
constant values that were used in Step 3, Exercise 3-1.
b. On the Limits tab, replace the constant, 0.05, with the following expression.
Parameters.TargetVoltage *.01
5. Call the new code module for the Voltage Test step which supports both DC and
AC tests and configure it as shown in the following table.
5-32 | ni.com
Developing Test Programs Using TestStand
6. Create a numeric limit test within the For loop, after the Voltage Test step, to call
the AC Output Frequency Test provided code module.
7. Add a precondition to the AC Frequency Test step so that the step executes only
if the expected frequency or voltage output is nonzero.
Note When the expected frequency is 0, then the signal is DC and you
don’t have to test it. If the expected voltage output is 0, then the system
does not have enough power to supply output voltage so you do not have
to test it.
a. Select the AC Frequency Test step and select Preconditions on the Properties
tab.
5-34 | ni.com
Developing Test Programs Using TestStand
c. In the Precondition Builder dialog box, build the expression to check the
expected voltage and target frequency.
2
1
1 Insert AllOf—Click to insert a new section where all conditions must be met.
2 Insert New Expression—Click and enter the following expression to determine if
the expected voltage is nonzero:
Locals.expectedVoltage != 0
3 Click the Insert New Expression button again to enter the following expression
that determines if the target frequency is nonzero:
Parameters.TargetFrequency != 0
d. Click OK and verify that the expression matches the following expression.
AllOf(Locals.expectedVoltage != 0, Parameters.TargetFrequency != 0)
8. Configure the Sequence Call step for the DC Power Output Test in the
MainSequence as outlined in the following table.
a. Verify the configuration of the DC Power Output Test sequence call as shown
in the following figure.
5-36 | ni.com
Developing Test Programs Using TestStand
10. Create action steps in the Setup and Cleanup groups of the MainSequence to
initialize and shut down the scope.
Note Shut down the scope before you shut down the power supply.
Test
1. Test a passing UUT.
a. In the Initialize Test Fixture step, verify that the Serial Number parameter is set
to "Golden".
c. Ensure that the Power Output Test subsequence runs twice: Once for the DC
test and once for the AC test.
5-38 | ni.com
Developing Test Programs Using TestStand
a. In the Initialize Test Fixture step, change the Serial Number parameter to
"AllFail". This serial number fails all tests except the thermal test.
b. Run the test again and ensure that the DC and AC tests both fail.
Scenario
As the test sequence expands, using a string constant for instrument names becomes
a maintenance burden. If the resource names were to change, updating the name in
all locations is tedious and prone to error. To avoid this, use a FileGlobal variable,
accessible anywhere in the sequence, to store the instrument names.
Implementation
Note If you have not completed the previous exercise, please refer to the
Course Project Exercise Setup section of the Student Guide.
• DMM
• PowerSupply
• Scope
5-40 | ni.com
Developing Test Programs Using TestStand
a. Enter the values for the instruments as shown in the following figure.
3. Use the Find/Replace tool to replace the constant instrument name strings in the
sequence file with references to the variable.
a. Select Edit»Find/Replace.
c. Click Find/Replace.
1 2
e. Click the Replace Found Text button to replace each match. The Value field
updates as you replace each item.
Test
1. Test a passing UUT.
a. Set the value of the DMM field of the Instruments global to "DMM1".
d. Reset the value of the DMM field of the Instruments global to "DMM".
5-42 | ni.com
Developing Test Programs Using TestStand
Scenario
According to the requirements document you must test the output voltage from the
solar panel as well as the resistance. (You created the resistance test in Exercise 2-2.)
In addition, you must test the solar panel output at varying lighting and temperature
conditions.
In this exercise, you update the Solar Panel Test sequence in the following ways.
• You create a new sequence that contains both the Resistance Test and the new
test to examine solar panel output voltage.
• You use a custom data type to manage input conditions of lighting and
temperature for each test case.
• You use nested loops to vary the lighting and temperature.
• Send the results of the Solar Panel Output Test sequence back to MainSequence.
1 The Resistance Test step is moved from MainSequence to Solar Panel Test
sequence and modified to skip the panel output voltage test if the Resistance Test
fails.
2 A For Each loop varies the ambient temperature over the number of temperatures
specified by a variable.
3 A nested For Each loop varies the light intensity over a number of values specified
by a variable.
Requirements
Refer to Appendix A, section B, Solar Panel Output, for specification requirements for
the Solar Panel Output Test.
Implementation
Note If you have not completed the previous exercise, please refer to the
Course Project Exercise Setup section of the Student Guide.
1. Create a new subsequence in TestStand to implement the solar panel output test.
b. Rename the subsequence Solar Panel Output Test in the New Subsequence
From Selected Steps dialog box.
Sequence Solar Panel Output Test (Module tab) Place a checkmark in the
Use Current File checkbox to populate
the Sequence drop-down menu.
2. A failed resistance test indicates a bad panel, and no further panel testing is
needed. Add a post action to the Resistance Test step so that the sequence skips
the output voltage tests upon failure of the Resistance Test.
a. Select the Resistance Test step in the Solar Panel Output Test sequence.
5-44 | ni.com
Developing Test Programs Using TestStand
b. In the Post Actions category of the Properties tab, select Goto Step in the On
Fail drop-down menu.
c. Select <End Group> in the bottom On Fail drop-down menu to skip to the end
of the Solar Panel Test sequence without testing voltage output.
3. Create a new local variable to store the values of the current temperature.
1 4
1 In the Variables pane, right-click Locals (‘Solar Panel Output Test’) and select
Insert Local»Array of»Number.
2 Set the Upper Bounds to 2 to create a three element array. The requirements
document (Appendix A) specifies three different light intensities to test and three
different temperatures to test.
3 Name the new variable Temperature.
4 Set the values of the array elements to 20, 40, and 60 to cover the temperature test
cases specified in the requirements document (Appendix A).
4. Create another local variable to store values for each light intensity you want to
test.
5-46 | ni.com
Developing Test Programs Using TestStand
5. Create a custom data type to manage input conditions of lighting and temperature
for a single test case.
b. In the View Types For pane, select Solar Panel Test.seq under Sequence Files.
Note Because the custom data type you are creating applies to only the
current sequence file, you store it in the sequence file rather than a type
palette.
c. Right-click Custom Data Types and select Insert Custom Data Type»Container.
f. On the Version tab of the SolarPanelSettings Properties dialog box, change the
version to 1.0.0.0 and click OK.
g. In the Confirm New Version dialog box, click Yes to update the version change.
5-48 | ni.com
Developing Test Programs Using TestStand
a. Right-click Locals (‘Solar Panel Output Test’) and select Insert Local»Type»
SolarPanelSettings.
c. Observe that the new variable is populated with the fields you defined in the
Types view.
1 2
7. Add a loop to iterate over the range of temperatures. Each iteration of the loop
uses the current test case temperature to test a different temperature.
a. Add a For Each loop step after the Resistance Test step.
b. Configure the For Each loop to iterate over the variable array
Locals.Temperature. The loop executes once per element in the array.
What variable do you think should appear in the Current Element field?
(Hint: You created a custom data type for this purpose.)
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
5-50 | ni.com
Developing Test Programs Using TestStand
8. Create a loop to iterate over the range of lighting intensities. Each iteration of the
loop uses the current test case lighting intensity.
a. Right-click the For Each loop you made for temperature and select Insert Step»
Flow Control»For Each to create a nested loop.
b. In the For Each Loop tab, set the Array to Iterate Over field to
Locals.LightIntensity.
9. Create an action step to set the ambient temperature within the outer For Each
loop but before the inner For Each loop.
5-52 | ni.com
Developing Test Programs Using TestStand
10. Create an action step to set the light intensity within the inner For Each loop.
1 Step 11 creates the action step to calculate the expected voltage using a provided
code module.
11. Create a new Action step after the Set Light Intensity step to calculate the
expected voltage. A code module which outputs the expected voltage based on
the requirements table is provided.
5-54 | ni.com
Developing Test Programs Using TestStand
1 Step 12 and step 13 create the code module and limit test step, respectively, that
determine whether the UUT passes or fails.
12. Create a code module in LabVIEW to implement the Voltage Output Test step.
a. In LabVIEW, create a new VI and save it as Panel Output Voltage Test.vi
in the C:\Exercises\Developing Test Programs\LabVIEW\Code Modules
directory.
b. Place the Configure VI and the Read Voltage VI from the DMM to the block
diagram of the Solar Panel Output Test VI.
Tip Press <Ctrl-Space> to use the Quick Drop dialog box to locate the VIs
or find them on the Instrument I/O»Instrument Drivers»Instrument
Simulation palette.
1 3 2 3
c. Configure the input and output terminals of the VIs as shown in the following
table.
Configure VI
1 Create a control for the DMM in input terminal. Right-click the input terminal and
select Create»Control from the shortcut menu.
2 Specify the Signal Type. Right-click the input terminal and select Create»Constant
from the shortcut menu. Select DC from the pull-down menu.
Read Voltage VI
1 3
1 Wire the DMM out terminal of the Configure VI to the DMM in terminal of the Read
Voltage VI.
2 Wire a constant with a value of 6 to the Channel input.
According to the requirements document, the output voltage for the panel is
measured on pin 6.
3 Create an indicator for the Voltage output. Right-click the terminal and select
Create»Indicator. Rename the indicator Voltage.
Note This code module is very simple and could be implemented through
direct driver calls in the sequence file. However, creating a code module has
the advantage of encapsulating test-specific information within the step,
such as the channel. If the test implementation changes, the required
changes will affect only the code module, not the sequence file.
5-56 | ni.com
Developing Test Programs Using TestStand
13. Add a Numeric Limit Test step to call the Panel Output Voltage Test code module
you created in step 12.
Test
1. Test a passing UUT.
a. In the Initialize Test Fixture step, change the serial number back to
"ResistanceFail". This represents a known bad UUT.
d. After the breakpoint is reached, step over the Resistance Test step.
e. Verify that the Solar Panel Output test now fails at the Resistance test, and
the remaining steps in the Solar Panel Output Test sequence do not execute.
4. In the Initialize Test Fixture step, change the serial number back to "Golden".
5-58 | ni.com
Developing Test Programs Using TestStand
Scenario
According to the requirements document you must test the output voltage from the
solar panel as well as the resistance. (You created the resistance test in Exercise 2-2.)
In addition, you must test the solar panel output at varying lighting and temperature
conditions.
In this exercise, you update the Solar Panel Test sequence in the following ways.
• You create a new sequence that contains both the Resistance Test and the new
test to examine solar panel output voltage.
• You use a custom data type to manage input conditions of lighting and
temperature for each test case.
• You use nested loops to vary the lighting and temperature.
• Send the results of the Solar Panel Output Test sequence back to MainSequence.
1 The Resistance Test step is moved from MainSequence to Solar Panel Output
Test sequence and modified to skip the panel output voltage test if the Resistance
Test fails.
2 A For Each loop varies the ambient temperature over the number of temperatures
specified by a variable.
3 A nested For Each loop varies the light intensity over a number of values specified
by a variable.
Requirements
Refer to Appendix A, section B, Solar Panel Output, for specification requirements for
the Solar Panel Output Test.
Implementation
Note If you have not completed the previous exercise, please refer to the
Course Project Exercise Setup section of the Student Guide.
1. Create a new subsequence in TestStand to implement the solar panel output test.
b. Rename the subsequence Solar Panel Output Test in the New Subsequence
From Selected Steps dialog.
Sequence Solar Panel Output Test (Module tab) Place a checkmark in the
Use Current File checkbox to populate
the Sequence drop-down menu.
2. A failed resistance test indicates a bad panel, and no further panel testing is
needed. Add a post action to the Resistance Test step so that the sequence skips
the output voltage tests upon failure of the Resistance Test.
5-60 | ni.com
Developing Test Programs Using TestStand
b. In the Post Actions category of the Properties tab, select Goto Step in the
On Fail drop-down menu.
c. Select <End Group> in the bottom On Fail drop-down menu to skip to the end
of the Solar Panel Test sequence without testing voltage output.
3. Create a new local variable to store the values of the current temperature.
1 4
1 In the Variables pane, right-click Locals (‘Solar Panel Output Test’) and select Insert
Local»Array of»Number.
2 Set the Upper Bounds to 2 to create a three element array. The requirements document
(Appendix A) specifies three different light intensities to test and three different
temperatures to test.
3 Name the new variable Temperature.
4 Set the values of the array elements to 20, 40, and 60 to cover the temperature test
cases specified in the requirements document (Appendix A).
4. Create another local variable to store values for each light intensity you want to
test.
5-62 | ni.com
Developing Test Programs Using TestStand
5. Create a custom data type to manage input conditions of lighting and temperature
for a single test case.
b. In the View Types For pane, select Solar Panel Test.seq under Sequence Files.
Note Because the custom data type you are creating applies to only the
current sequence file, you store it in the sequence file rather than a type
palette.
C
c. Right-click Custom Data Types and select Insert Custom Data Type»Container.
f. On the Version tab of the SolarPanelSettings Properties dialog box, change the
version to 1.0.0.0 and click OK.
g. In the Confirm New Version dialog, click Yes to update the version change.
5-64 | ni.com
Developing Test Programs Using TestStand
a. Right-click Locals (‘Solar Panel Output Test’) and select Insert Local»Type»
SolarPanelSettings.
c. Observe that the new variable is populated with the fields you defined in the
Types view.
1
2
7. Add a loop to iterate over the range of temperatures. Each iteration of the loop
uses the current test case temperature to test a different temperature.
a. Add a For Each loop step after the Resistance Test step.
b. Configure the For Each loop to iterate over the variable array
Locals.Temperature. The loop executes once per element in the array.
What variable do you think should appear in the Current Element field?
(Hint: You created a custom data type for this purpose.)
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
5-66 | ni.com
Developing Test Programs Using TestStand
8. Create a loop to iterate over the range of lighting intensities. Each iteration of the
loop uses the current test case lighting intensity.
a. Right-click the For Each loop you made for temperature and select Insert Step»
Flow Control»For Each to create a nested loop.
b. In the For Each Loop tab, set the Array to Iterate Over field to
Locals.LightIntensity.
9. Create an action step to set the ambient temperature within the outer For Each
loop but before the inner For Each loop.
10. Create an action step to set the light intensity within the inner For Each loop.
5-68 | ni.com
Developing Test Programs Using TestStand
1 Step 11 creates the action step to calculate the expected voltage using a provided
code module.
11. Create a new action step after the Set Light Intensity step to calculate the
expected voltage. A code module which outputs the expected voltage based on
the requirements table is provided.
a. In the step Properties tab, change the Adapter to LabVIEW to utilize the VI.
1 Step 12 and step 13 create the code module and limit test step, respectively, that
determine whether the UUT passes or fails.
12. Create a new code module to implement the solar panel output test.
a. Open the SolarPanelTest.c file in LabWindows/CVI and add the following code
module:
5-70 | ni.com
Developing Test Programs Using TestStand
13. Add a Numeric Limit Test step to call the Panel Output Voltage Test code module
you created in step 12.
Test
1. Test a passing UUT.
a. In the Initialize Test Fixture step, change the serial number back to
"ResistanceFail". This represents a known bad UUT.
d. After the breakpoint is reached, step over the Resistance Test step.
e. Verify that the Solar Panel Output test now fails at the Resistance test, and
the remaining steps in the Solar Panel Output Test sequence do not execute.
4. In the Initialize Test Fixture step, change the serial number back to "Golden"
5-72 | ni.com
Developing Test Programs Using TestStand
Scenario
According to the requirements document you must test the output voltage from the
solar panel as well as the resistance. (You created the resistance test in Exercise 2-2.)
In addition, you must test the solar panel output at varying lighting and temperature
conditions.
In this exercise, you update the Solar Panel Test sequence in the following ways.
• You create a new sequence that contains both the Resistance Test and the new
test to examine solar panel output voltage.
• You use a custom data type to manage input conditions of lighting and
temperature for each test case.
• You use nested loops to vary the lighting and temperature.
• Send the results of the Solar Panel Output Test sequence back to MainSequence.
1 The Resistance Test step is moved from MainSequence to Solar Panel Test
sequence and modified to skip the panel output voltage test if the Resistance Test
fails.
2 A For Each loop varies the ambient temperature over the number of temperatures
specified by a variable.
3 A nested For Each loop varies the light intensity over a number of values specified
by a variable.
Requirements
Refer to Appendix A, section B, Solar Panel Output, for specification requirements for
the Solar Panel Output Test.
Implementation
Note If you have not completed the previous exercise, please refer to the
Course Project Exercise Setup section of the Student Guide.
1. Create a new subsequence in TestStand to implement the solar panel output test.
b. Rename the subsequence Solar Panel Output Test in the New Subsequence
From Selected Steps dialog.
Sequence Solar Panel Output Test (Module tab) Place a checkmark in the
Use Current File checkbox to populate
the Sequence drop-down menu.
2. A failed resistance test indicates a bad panel, and no further panel testing is
needed. Add a post action to the Resistance Test step so that the sequence skips
the output voltage tests upon failure of the Resistance Test.
5-74 | ni.com
Developing Test Programs Using TestStand
b. In the Post Actions category of the Properties tab, select Goto Step in the
On Fail drop-down menu.
c. Select <End Group> in the bottom On Fail drop-down menu to skip to the end
of the Solar Panel Test sequence without testing voltage output.
3. Create a new local variable to store the values of the current temperature.
1 4
1 In the Variables pane, right-click Locals (‘Solar Panel Output Test’) and select
Insert Local»Array of»Number.
2 Set the Upper Bounds to 2 to create a three element array. The requirements
document (Appendix A) specifies three different light intensities to test and three
different temperatures to test.
3 Name the new variable Temperature.
4 Set the values of the array elements to 20, 40, and 60 to cover the temperature test
cases specified in the requirements document (Appendix A).
4. Create another local variable to store values for each light intensity you want to
test.
5-76 | ni.com
Developing Test Programs Using TestStand
5. Create a custom data type to manage input conditions of lighting and temperature
for a single test case.
b. In the View Types For pane, select Solar Panel Test.seq under Sequence Files.
Note Because the custom data type you are creating applies to only the
current sequence file, you store it in the sequence file rather than a type
palette.
c. Right-click Custom Data Types and select Insert Custom Data Type»Container.
f. On the Version tab of the SolarPanelSettings Properties dialog box, change the
version to 1.0.0.0 and click OK.
g. In the Confirm New Version dialog, click Yes to update the version change.
5-78 | ni.com
Developing Test Programs Using TestStand
a. Right-click Locals (‘Solar Panel Output Test’) and select Insert Local»Type»
SolarPanelSettings.
c. Observe that the new variable is populated with the fields you defined in the
Types view.
1
2
7. Add a loop to iterate over the range of temperatures. Each iteration of the loop
uses the current test case temperature to test a different temperature.
a. Add a For Each loop step after the Resistance Test step.
b. Configure the For Each loop to iterate over the variable array
Locals.Temperature. The loop executes once per element in the array.
What variable do you think should appear in the Current Element field?
(Hint: You created a custom data type for this purpose.)
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
5-80 | ni.com
Developing Test Programs Using TestStand
8. Create a loop to iterate over the range of lighting intensities. Each iteration of the
loop uses the current test case lighting intensity.
a. Right-click the For Each loop you made for temperature and select Insert Step»
Flow Control»For Each to create a nested loop.
b. In the ForEach Loop tab, set the Array to Iterate Over field to
Locals.LightIntensity.
9. Create an action step to set the ambient temperature within the outer For Each
loop but before the inner For Each loop.
5-82 | ni.com
Developing Test Programs Using TestStand
10. Create an action step to set the light intensity within the inner For Each loop.
1 Step 11 creates the action step to calculate the expected voltage using a provided
code module.
11. Create a new Action step after the Set Light Intensity step to calculate the
expected voltage.
5-84 | ni.com
Developing Test Programs Using TestStand
1 Step 12 creates limit test step, that determine whether the UUT passes or fails.
12. Add a Numeric Limit Test step to call the Panel Output Voltage Test.
Test
1. Test a passing UUT.
a. In the Initialize Test Fixture step, change the serial number back to
"ResistanceFail". This represents a known bad UUT.
d. After the breakpoint is reached, step over the Resistance Test step.
e. Verify that the Solar Panel Output test now fails at the Resistance test, and
the remaining steps in the Solar Panel Output Test sequence do not execute.
4. In the Initialize Test Fixture step, change the serial number back to "Golden".
5-86 | ni.com
Developing Test Programs Using TestStand
Scenario
In this exercise, you use the Import/Export Properties dialog box to export the
LightIntensity and Temperature local variables for the Solar Panel Output Test
sequence from the sequence file to a text file. You then modify them in the text file
and import to the sequence file.
Implementation
Note If you have not completed the previous exercise, please refer to the
Course Project Exercise Setup section of the Student Guide.
1. Launch the Import/Export Properties dialog box to export the properties to a file.
c. Select NI Tab Delimited Text file for the Destination Type option in the Export
Options tab.
f. In the Property Selector tab select the Solar Panel Output Test sequence from
the Select Sequence drop-down menu.
2. Modify the selected properties in the file you specified on the Export Options tab.
5-88 | ni.com
Developing Test Programs Using TestStand
b. Modify the values for the LightIntensity and Temperature local variables as
shown in the following figure.
a. Click Import in the left side of the Import/Export Properties dialog box.
b. Select NI Tab Delimited Text for the Source Type option in the Import Options
tab.
d. Click Import.
4. Verify that the modified properties are changed in the sequence file.
a. Navigate to the Variables pane in the Solar Panel Output Test sequence.
b. Expand the Locals (‘Solar Panel Output Test’) and verify that the values for the
LightIntensity and Temperature variables have been changed to the values that
you specified in the text file.
5. Revert the local variable values back to the original values specified in the
requirements document as shown in the figure below.
5-90 | ni.com
6 Storing and
Presenting Test
Results
Activities
+ Generate a Default Report
Exercises
Exercise 6-1 Configure Results Collection
Exercise 6-2 Configure Report Path Settings
Exercise 6-3 Log Additional Results
Exercise 6-4 Log Results to a Database
Lesson 6 Storing and Presenting Test Results
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
4. Why do some items have a Done status and others have a Passed/Failed status?
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
6-2 | ni.com
Developing Test Programs Using TestStand
Scenario
Now that the test requirements have been met, you want to look at the results of the
tests in more detail. To avoid extraneous information in a report, you can configure the
sequence file to filter unnecessary data from the report. For example, test operators
need different report information than technicians, so you can filter results according
to the user’s needs.
In this exercise, you configure a result filter to prevent any flow control steps, such as
For loops, from appearing in the report. You also configure results recording to remove
other non-test steps, such as Statement steps, from the report.
Implementation
Note If you have not completed the previous exercise, please refer to the
Course Project Exercise Setup section of the Student Guide.
1. Complete the following steps to add a filter to the result recording that removes
flow control steps from the report.
c. In the Result Filtering Expression field, select Exclude Flow Control from the
drop-down menu.
d. Click in the Result Filtering Expression field and display the underlying
expression.
1 The expression is evaluated for each step, and the step is logged only if the
expression evaluates True.
Note This expression prevents the data from being added to the report,
but the results are still collected into the ResultList. Because of this, other
plug-ins, such as the database logger, still log these steps.
6-4 | ni.com
Developing Test Programs Using TestStand
2. Complete the following steps to disable results for steps that do not provide actual
test results.
a. Select the following steps in MainSequence by pressing the <Ctrl> key and
clicking the items.
c. Select Disabled from the Result Recording Option to disable result recording
for the selected steps.
Note This expression prevents data from being added to the Result List by
the result collection process. Therefore, disabling result reporting prevents
the step result from being logged by all plug-ins.
3. Repeat Step 2 to disable result recording for the following steps that do not provide
actual test results.
Note You do not disable reporting for Set Ambient Temperature and Set
Ambient Lighting here because reporting for these steps will be customized
in another exercise.
Test
1. Verify that only desired results are in the report.
a. Select Execute»Single Pass from the menu to run the sequence using the
Single Pass entry point.
b. Verify that the resulting report does not contain any flow control steps.
c. Verify that the resulting report contains only steps with result recording
enabled.
6-6 | ni.com
Developing Test Programs Using TestStand
Scenario
When testing many units, it is helpful to have a specific location for the reports for
failed units. This way, test technicians can easily find information on specific tests,
and test managers can get an overview of the number of failing units. It is also useful
to include the serial number in the report name so that the failing unit can be identified
without opening the report file.
In this exercise you use the report file path settings to configure the report folder based
on the test result. You also configure the report file name to include the serial number
of the unit tested.
Implementation
Note If you have not completed the previous exercise, please refer to the
Course Project Exercise Setup section of the Student Guide.
c. On the Report File Pathname tab, select Specify Report File Path by Expression
in the File/Directory Options field.
d. The Report File Path expression uses macros. The syntax of a macro is
$(MacroName), where MacroName is the name of the macro you want to use.
Modify the expression to use the following macros.
$(UUT) Is the serial number of the unit under test. Including this
information in the filename makes it easy to see which
units passed or fail.
Tip For a list of available macros for the Specify Report File Path by
Expression control, refer to the Specifying Report File Paths by Expression
topic in the TestStand Help.
3
1
6-8 | ni.com
Developing Test Programs Using TestStand
2. Complete the following steps to configure TestStand to use the serial number
entered during the Test UUTs entry point
Note You use the Test UUTs Execution entry point to start an execution
that continuously tests UUTs. This topic will be covered more detailed in
Lesson 07 Executing a Test Sequence For Multiple UUTs of this course.
b. Change the value of the serial number parameter to the following expression.
#NoValidation(RunState.Root.Locals.UUT.SerialNumber)
c. Verify that UUT.SerialNumber exists in the process model sequence. The serial
number is stored in a local variable in the Test UUTs sequence:
Locals.UUT.SerialNumber.
• View the process model that the Solar Panel Test sequence uses.
6-10 | ni.com
Developing Test Programs Using TestStand
Test
1. Test a passing UUT.
a. Select Execute»Test UUTs from the menu to begin testing at the Test UUTs
entry point.
Note The single pass entry point will cause an Invalid Serial Number error
from the simulated test fixture, because Single Pass does not set the serial
number. You update Single Pass in another exercise.
b. Enter Golden in the Enter UUT Serial Number field of the UUT Information
dialog box.
f. Within the Passed folder, verify that a report is present and the filename
contains the serial number Golden.
f. Within the Failed folder, verify that a report is present and the filename
contains the serial number AllFail.
Scenario
In order to provide as much information as possible about the test, use additional
results to log relevant test parameters and other useful information to the report. With
more information, technicians can better understand any failures without having to
manually retest the UUT.
In this exercise, you update the Visual Inspection test to allow the operator to enter
more information about a failure and configure the report to feedback from the
operator. You also configure the reports to include the following information.
• Ambient temperature and light intensity from the Current Test case.
• Waveform graph of data from the AC Frequency Test step.
• Graph of the results from the Power Output Test step.
Implementation
Note If you have not completed the previous exercise, please refer to the
Course Project Exercise Setup section of the Student Guide.
1. Complete the following steps to use the ReportText property to add a message to
the log if visual inspection fails.
b. On the Options tab, place a checkmark in the Enable Response Text Box
checkbox to allow the operator to provide details.
c. Enter "If the unit failed, enter details here." in the Initial Response
String field.
6-12 | ni.com
Developing Test Programs Using TestStand
d. On the Properties tab, click the Expressions category and enter the following
expression in the Post-Expression textbox.
(Step.Result.ButtonHit == 1) ? False :
(Step.Result.ReportText = "UUT failed visual inspection. Details:" +
Step.Result.Response, Step.Result.Status = "Failed")
2. Complete the following steps to log information about the current test case for the
solar panel output test.
a. In the Solar Panel Output Test sequence, select the Set Ambient Temperature
step.
b. On the Module tab, enable the Log checkbox for the Value parameter. Enabling
this option logs the current ambient temperature to the report.
Note You can also log a parameter in the Additional Results category of the
Properties tab for the step.
3. Complete the following steps to log a graph of the waveform data obtained by the
AC Frequency Test step.
a. In the Power Output Test sequence, select the AC Frequency Test step.
b. On the Module tab, enable the Log checkbox for the Waveform Data parameter
to log the oscilloscope reading as a graph on the report.
c. Configure the report options to display up to 10,000 data points in the graph.
• In the Include Step Results section, set the Max Elements field to 10000.
Note The Include Arrays setting allows you to configure whether array
data is logged as a graph or as a table.
• Click OK twice to close the Report Options and Result Processing dialog
boxes.
4. Complete the following steps to add a new step to graph the results of the Power
Output Test.
• In the Power Output Test sequence, right-click the Locals section of the
Variables tab and select Insert Local»Array of»Number.
• In the Array Bounds dialog box, verify that the Upper Bounds is set to 9
and the Lower Bounds is set to 0 and click OK.
6-14 | ni.com
Developing Test Programs Using TestStand
b. Add an Additional Results step at the end of the Main step group:
• Right-click the end of the Main step group and select Insert Step»
Additional Results from the shortcut menu.
• On the Additional Results tab, click the Add Custom Result button to add
a new item to log.
• In the Value to Log field, enter Locals.Result to log the new array.
• On the Module tab change the Value for the Output Voltage parameter (for
LabVIEW) or ACout parameter (for LabWindows/CVI) to
Locals.Result[Locals.inputVoltage].
• On the Module tab using LabWindows/CVI, change the Value for the
ACout parameter to Locals.Result[Locals.inputVoltage].
• On the Data Source tab, set the data source to the same expression:
Locals.Result[Locals.inputVoltage].
This configures the step to evaluate its result using the current array
element.
Test
1. Test a passing UUT.
e. Verify that the light intensity and temperature are logged for the solar panel
output test sequence.
f. Verify that the power output test results display a graph of the frequency
results and the overall power output results.
c. When prompted to inspect the UUT, enter some sample text into the text box,
then click Cancel.
e. Click Terminate on the Testing Terminated for Current UUT dialog box to end
testing.
f. Verify that the report contains a message indicating that the UUT failed visual
inspection, and the message contains the sample text you typed.
6-16 | ni.com
Developing Test Programs Using TestStand
Scenario
Logging to a database can be useful if you want to view or analyze historical test
results from one or many test stations.
In this exercise, you configure the sequence to use a default schema to log data to a
database. You then review the results in the Database Viewer.
Implementation
Note If you have not completed the previous exercise, please refer to the
Course Project Exercise Setup section of the Student Guide.
b. Select the Enabled checkbox for the Database plug-in to allow TestStand log
result to a database each time a sequence runs.
c. Click the Options button for the Database item to configure the options for
database logging.
d. Enable the Use On-The-Fly Logging checkbox in the Logging Options to allow
TestStand to log data while sequence runs.
Note This option slows the execution time for the sequence.
e. Select the Exclude Flow Control from the Result Filtering Expression
drop-down menu to configure the database to exclude the flow control step
results.
g. Click the Build button to launch a wizard to build the connection string.
h. In the Data Link Properties dialog, click Test Connection. This verifies that you
are able to connect to the specified database.
j. Verify that the Generic Recordset (NI) schema is checked in Schemas tab.
k. Select View Data to launch the Database Viewer tool in the Logging/Data Link
Options tab.
6-18 | ni.com
Developing Test Programs Using TestStand
Test
1. Use the Database Viewer tool in TestStand to review the results in the database.
f. To view the logged data from the execution that was run, right-click on the
UUT_RESULT and select View Data. The resulting window displays the logged
results for UUT_RESULT and the STATION_ID is located in the second column.
g. You can also view the data for each step by right-clicking on the STEP_RESULT
table and selecting View Data.
Exercises
Exercise 7-1 Customize Serial Number Entry
Exercise 7-2 Execute Steps When the Sequence File Loads
Lesson 7 Executing a Test Sequence For Multiple UUTs
Scenario
The default TestStand UUT Information dialog box simply asks users to enter a serial
number. Because manual entry of serial numbers might cause errors, a better UI design
is to have a drop-down menu of available serial numbers that a user can select.
In this exercise, you delete the default TestStand UUT Information dialog box and
replace it with a custom dialog box implemented by a code module.
Implementation
Note If you have not completed the previous exercise, please refer to the
Course Project Exercise Setup section of the Student Guide.
1. Complete the following steps to override the PreUUT callback to call a provided
custom serial number dialog.
7-2 | ni.com
Developing Test Programs Using TestStand
c. Verify that the Present field changes to yes and click OK to close the dialog
box.
d. Select the PreUUT sequence. Note that the sequence is populated with the
steps and variables to implement the default serial number dialog.
e. Delete the Call DoPreUUT step to remove the default UUT Information dialog
box.
f. Create an action step in the Main step group to call the provided code module
to display a serial number dialog box to the user.
7-4 | ni.com
Developing Test Programs Using TestStand
Test
1. Test a passing UUT.
b. Verify that the default serial entry dialog is replaced by the custom dialog,
which provides a drop-down menu containing all available UUTs.
d. Verify the test sequence passed and click OK in the UUT Result dialog box.
Scenario
To ensure a standard setup procedure, operators can use a checklist to help them set
up the test.
In this exercise you create a new Message Popup step that displays a dialog box
prompting the operator with a test setup checklist. This popup checklist appears only
when the sequence file is first loaded from disk and not before each execution of the
test sequence.
Implementation
Note If you have not completed the previous exercise, please refer to the
Course Project Exercise Setup section of the Student Guide.
b. Select the SequenceFileLoad engine callback and click the Add button.
c. Verify that the Present field changes to yes and click OK to dismiss the dialog.
e. Create a Message Popup step in the Main step group of the SequenceFileLoad
sequence.
7-6 | ni.com
Developing Test Programs Using TestStand
Test
1. Test that the message appears when loading the sequence file.
Activities
+ What problems can arise from serial testing?
Exercises
Exercise 8-1 Execute a Step Asynchronously
Exercise 8-2 (LabVIEW) Execute Tests in Parallel
Exercise 8-2 (LabWindows/CVI) Execute Tests in Parallel
Exercise 8-2 (TestStand Only) Execute Tests in Parallel
Lesson 8 Executing Tests in Parallel
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
8-2 | ni.com
Developing Test Programs Using TestStand
Scenario
Currently, the test sequence tests the UUT temperature before testing the components
of the unit. However, this approach does not detect conditions where the UUT
overheats in an unexpected way during the rest of the test.
In this exercise you replace the existing Controller Board Thermal Test step with a
temperature monitoring sequence that executes in parallel with the test sequence and
continually monitors the UUT temperature.
Implementation
Note If you have not completed the previous exercise, please refer to the
Course Project Exercise Setup section of the Student Guide.
1. Complete the following steps to add a sequence call step that calls the provided
temperature monitor sequence file.
b. Create a new Sequence Call step at the end of the Setup step group to start
the temperature monitor.
Parameter DMM—FileGlobals.Instruments.DMM
configuration MaxTemperature—62
• Select Use New Thread in the Execution Options field to configure the
sequence to execute in a new thread.
8-4 | ni.com
Developing Test Programs Using TestStand
c. Create a new Sequence Call step at the beginning of the Cleanup step group
to stop the monitor.
This sequence sends a notification to the Temperature Monitor VI to stop
executing.
d. Create a Wait step to collect the result data from the Thermal Monitor thread.
• Right-click the Shut Down Thermal Monitor step and select Insert Step»
Synchronization»Wait from the shortcut menu.
e. Drag the Visual Inspection step before the Initialize Thermal Monitor step.
f. Change the post action of the Visual Inspection step to go to the <Cleanup>
step group when the condition is false. (The condition is false when the UUT
fails the Visual Inspection test.)
8-6 | ni.com
Developing Test Programs Using TestStand
Test
1. Test a passing UUT.
d. Verify that the temperature monitor graph appears and shows the temperature
data in real time as the test executes.
g. Verify that the temperature data appears in the report under the Monitor
Temperature step.
d. Verify that the sequence terminates when the temperature exceeds the
threshold.
Scenario
Testing multiple units at once can improve the test time per unit by improving
hardware utilization. Parallel testing can also reduce cost of test by sharing testing
resources across multiple UUTs. You have an additional DMM at your disposal, so you
decide to test two units at a time.
In this exercise you use the batch process model to test two units simultaneously using
a single sequence file. In the solar panel test, the light and temperature of the
environment are configured, which affects all UUTs. You also add steps to the test
sequence to prevent race conditions and synchronize test steps.
Implementation
Note If you have not completed the previous exercise, please refer to the
Course Project Exercise Setup section of the Student Guide.
1. Complete the following steps to configure the sequence file to use the batch
process model.
b. On the Advanced tab, select Require Specific Model from the Model Option
drop-down menu.
8-8 | ni.com
Developing Test Programs Using TestStand
d. Click OK and verify that the Model shown in the status bar is now
BatchModel.seq.
2. Complete the following steps to add a new callback to set the number of sockets
for the sequence and the test fixture to two.
b. Add the ModelOptions callback and click OK to dismiss the dialog box.
The ModelOptions callback allows you to configure specific model settings for
the sequence file independent of the global model settings. You can view and
change the global model settings through Configure»Model Options. If a
particular sequence file requires specific model settings, use the ModelOptions
callback to override the global model settings.
c. Create a Statement step in the Main step group of the ModelOptions callback
sequence to set the number of test sockets to 2.
e. Create an Action step before the Serial Number Dialog step to configure the
number of active test sockets in the test fixture to the number in the
ModelOptions callback.
3. Complete the following steps to configure the sequence file to utilize the additional
DMM.
8-10 | ni.com
Developing Test Programs Using TestStand
4. Complete the following steps to configure initialization and shut down of the
Scope and Power Supply to occur only in one test socket.
a. Ctrl-click the Initialize Scope, Initialize Power Supply, Shut Down Scope, and
Shut Down Power Supply steps to select them.
b. In the Synchronization section of the Properties tab, select One thread only
(first thread executes step, remaining threads skip) from the Batch
Synchronization drop-down menu.
The One thread only setting ensures that the initialize and close will only be
called once, since the resource is shared across both sockets.
Note You can lower the cost to test by sharing hardware resources across
multiple test sockets. In this case, the Scope and Power Supply will be
shared since they are higher cost instruments. In a real system, evaluate
whether the cost savings of sharing hardware is worth the slowdown in test
time.
a. Select the Panel Output Voltage Test step in the Solar Panel Output Test
Sequence.
b. In the Synchronization section of the Properties tab, select Parallel (all threads
enter simultaneously) from the Batch Synchronization drop-down menu.
The Parallel setting ensures that the step does not execute until all sockets
have reached the step. This ensures that the ambient lighting and temperature
are set before the test is executed by any test socket.
c. Ctrl-click the Set Ambient Temperature and Set Light Intensity steps to select
them.
d. In the Synchronization section of the Properties tab, select One thread only
from the Batch Synchronization drop-down menu.
Use the One thread only setting because the ambient settings need to be
configured only once for all test sockets.
8-12 | ni.com
Developing Test Programs Using TestStand
6. In the Power Output Test sequence, the AC frequency test depends on the power
supply setting in the previous step (Voltage Test). If another socket were to
change the power supply setting before the AC test executed, the AC test would
yield incorrect results. Complete the following steps to use a lock to prevent this
race condition in the Power Output Test.
a. In the Power Output Test sequence, insert a lock step before the Voltage Test
step.
Lock Step
Name Lock
Operation Lock
Create lock if it Place a checkmark in You can also create a lock with a
does not exist the checkbox. separate lock step using the Create
operation.
Unlock Step
Name Unlock
Lock Name "PowerSupply" The lock name is arbitrary, but using an instrument
or Reference resource name is a good way to show that the lock is
Expression reserving that instrument.
8-14 | ni.com
Developing Test Programs Using TestStand
7. Complete the following steps to set the test socket index in the code modules so
that the hardware for each socket measures the corresponding UUT.
a. Update the code module parameter for the Initialize Test Fixture Step.
• On the Module tab, uncheck the Default checkbox for the Test Socket
field.
b. Update the code module parameter for the Resistance Test step.
• In the Solar Panel Output Test sequence, select the Resistance Test step.
• On the Module tab, uncheck the Default checkbox for the Test Socket
field.
Note The simulated driver uses a socket input in all read/write calls to
specify the current test socket from which to measure. In a real test system,
switch hardware is typically used to connect test hardware to the active
UUT.
c. Update the code module for the Panel Output Voltage Test step.
• In the Solar Panel Output Test sequence, select the Panel Output Voltage
Test step.
• On the Module tab, click the Edit VI button to open the code module in
LabVIEW.
• Right-click the Test Socket input of the Read Voltage VI and select Create»
Control.
• Rename the control Socket Index and add the control to the VI connector
pane.
• In the Power Output Test sequence, select the Voltage Test step.
• Right-click the Test Socket input of the Read Voltage VI and select Create»
Control.
• Wire the Socket Index control to the Test Socket input of the Generate
Voltage - DC VI in addition to the Read Voltage VI.
• In the Power Output Test sequence, select the AC Frequency Test step.
• Rename the control Socket Index and add the control to the VI connector
pane.
8-16 | ni.com
Developing Test Programs Using TestStand
Test
1. Test passing UUTs.
c. Enter Golden for both test socket serial numbers and click Go.
d. Verify that the execution window is split into 2 panes, one for each test
socket.
f. Verify that two temperature monitor graphs appear and show the temperature
data in real time as the test executes.
g. Verify that the result dialog box indicates that both units passed.
e. Verify that the result dialog indicates that socket 0 passed, but socket 1 failed.
Challenge
Execute the test on UUTs 0 – 9, and determine which units are passing.
1. Run the test using Test UUTs to run the test on UUT serial numbers 0 – 9.
Tip Use the report location to review the results for previous tests.
8-18 | ni.com
Developing Test Programs Using TestStand
Scenario
Testing multiple units at once can improve the test time per unit by improving
hardware utilization. Parallel testing can also reduce cost of test by sharing testing
resources across multiple UUTs. You have an additional DMM at your disposal, so you
decide to test two units at a time.
in this exercise you use the batch process model to test two units simultaneously using
a single sequence file. In the Solar Panel test, the light and temperature of the
environment are configured, which affects all UUTs. You also add steps to the test
sequence to prevent race conditions and synchronize test steps.
Implementation
Note If you have not completed the previous exercise, please refer to the
Course Project Exercise Setup section of the Student Guide.
1. Complete the following steps to configure the sequence file to use the batch
process model.
b. On the Advanced tab, select Require Specific Model for the Model Option
drop-down menu.
d. Click OK and verify that the Model shown in the status bar is now
BatchModel.seq.
2. Complete the following steps to add a new callback to set the number of sockets
for the sequence and the test fixture to two.
b. Add the ModelOptions callback and click OK to dismiss the dialog box.
The ModelOptions callback allows you to configure specific model settings for
the sequence file independent of the global model settings. You can view and
change the global model settings through Configure»Model Options. If a
particular sequence file requires specific model settings, use the ModelOptions
callback to override the global model settings.
c. Create a Statement step in the Main step group of the ModelOptions callback
sequence to set the number of test sockets to 2.
8-20 | ni.com
Developing Test Programs Using TestStand
e. Create an Action step before the Serial Number Dialog step to configure the
number of active test sockets in the test fixture to the number in the
ModelOptions callback.
3. Complete the following steps to configure the sequence file to utilize the additional
DMM.
4. Complete the following steps to configure initialization and shut down of the
Scope and Power Supply to occur only in one test socket.
a. Ctrl-click the Initialize Scope, Initialize Power Supply, Shut Down Scope, and
Shut Down Power Supply steps to select them.
b. In the Synchronization section of the Properties tab, select One thread only
(first thread executes step, remaining threads skip) from the Batch
Synchronization drop-down menu.
The One thread only setting ensures that the initialize and close will only be
called once, since the resource is shared across both sockets.
Note You can lower the cost to test by sharing hardware resources across
multiple test sockets. In this case, the Scope and Power Supply will be
shared since they are higher cost instruments. In a real system, evaluate
whether the cost savings of sharing hardware is worth the slowdown in test
time.
8-22 | ni.com
Developing Test Programs Using TestStand
a. Select the Panel Output Voltage Test step in the Solar Panel Output Test
Sequence.
b. In the Synchronization section of the Properties tab, select Parallel (all threads
enter simultaneously) from the Batch Synchronization drop-down menu.
The Parallel setting ensures that the step does not execute until all sockets
have reached the step. This ensures that the ambient lighting and temperature
are set before the test is executed by any test socket.
c. Ctrl-click the Set Ambient Temperature and Set Light Intensity steps to select
them.
d. In the Synchronization section of the Properties tab, select One thread only
from the Batch Synchronization drop-down menu.
Use the One thread only setting because the ambient settings need to be
configured only once for all test sockets.
6. In the Power Output Test sequence, the AC frequency test depends on the power
supply setting in the previous step (Voltage Test). If another socket were to
change the power supply setting before the AC test executed, the AC test would
yield incorrect results. Complete the following steps to use a lock to prevent this
race condition in the Power Output Test.
a. In the Power Output Test sequence, insert a lock step before the Voltage Test
step.
Lock Step
Name Lock
Operation Lock
Create lock if it Place a checkmark in You can also create a lock with a
does not exist the checkbox. separate lock step using the Create
operation.
8-24 | ni.com
Developing Test Programs Using TestStand
Unlock Step
Name Unlock
7. Complete the following steps to set the test socket index in the code modules so
that the hardware for each socket measures the corresponding UUT.
a. Update the code module parameter for the Initialize Test Fixture step.
• On the Module tab, replace the "0" constant for socketIndex with
RunState.Testsockets.MyIndex.
• Repeat the previous 2 steps for the Resistance Test step in the Solar Panel
Output Test.
Note The simulated driver uses a socket input in all read/write calls to
specify the current test socket to measure from. In a real test system,
switch hardware is typically used to connect test hardware to the active
UUT.
b. Update the code module for the Panel Output Voltage Test step.
• Add the "int socket" parameter in all the functions in the .c file.
• Update any driver functions that contain "generate" or "read" in the name
to use the parameter instead of "0" as shown in the figure.
8-26 | ni.com
Developing Test Programs Using TestStand
e. Repeat the steps 7c and 7d for the Voltage Test and AC Frequency Test steps
in the Power Output Test sequence.
Test
1. Test passing UUTs.
c. Enter Golden for both test socket serial numbers and click Go.
d. Verify that the execution window is split into 2 panes, one for each test
socket.
f. Verify that two temperature monitor graphs appear and show the temperature
data in real time as the test executes.
g. Verify that the result dialog box indicates that both units passed.
8-28 | ni.com
Developing Test Programs Using TestStand
e. Verify that the result dialog indicates that socket 0 passed, but socket 1 failed.
Challenge
Execute the test on UUTs 0 – 9, and determine which units are passing.
1. Run the test using Test UUTs to run the test on UUT serial numbers 0 – 9.
Tip Use the report location to review the results for previous tests.
Scenario
Testing multiple units at once can improve the test time per unit by improving
hardware utilization. Parallel testing can also reduce cost of test by sharing testing
resources across multiple UUTs. You have an additional DMM at your disposal, so you
decide to test two units at a time.
In this exercise you use the batch process model to test two units simultaneously using
a single sequence file. In the solar panel test, the light and temperature of the
environment are configured, which affects all UUTs. You also add steps to the test
sequence to prevent race conditions and synchronize test steps.
Implementation
Note If you have not completed the previous exercise, please refer to the
Course Project Exercise Setup section of the Student Guide.
1. Complete the following steps to configure the sequence file to use the batch
process model.
b. On the Advanced tab, select Require Specific Model from the Model Option
drop-down menu.
8-30 | ni.com
Developing Test Programs Using TestStand
2. Complete the following steps to add a new callback to set the number of sockets
for the sequence and the test fixture to two.
b. Add the ModelOptions callback and click OK to dismiss the dialog box.
The ModelOptions callback allows you to configure specific model settings for
the sequence file independent of the global model settings. You can view and
change the global model settings through Configure»Model Options. If a
particular sequence file requires specific model settings, use the ModelOptions
callback to override the global model settings.
c. Create a Statement step in the Main step group of the ModelOptions callback
sequence to set the number of test sockets to 2.
e. Create an Action step before the Serial Number Dialog step to configure the
number of active test sockets in the test fixture to the number in the
ModelOptions callback.
3. Complete the following steps to configure the sequence file to utilize the additional
DMM.
8-32 | ni.com
Developing Test Programs Using TestStand
4. Complete the following steps to configure initialization and shut down of the
Scope and Power Supply to occur only in one test socket.
a. Ctrl-click the Initialize Scope, Initialize Power Supply, Shut Down Scope, and
Shut Down Power Supply steps to select them.
b. In the Synchronization section of the Properties tab, select One thread only
(first thread executes step, remaining threads skip) from the Batch
Synchronization drop-down menu.
The One thread only setting ensures that the initialize and close will only be
called once, since the resource is shared across both sockets.
Note You can lower the cost to test by sharing hardware resources across
multiple test sockets. In this case, the Scope and Power Supply will be
shared since they are higher cost instruments. In a real system, evaluate
whether the cost savings of sharing hardware is worth the slowdown in test
time.
a. Select the Panel Output Voltage Test step in the Solar Panel Output Test
Sequence.
b. In the Synchronization section of the Properties tab, select Parallel (all threads
enter simultaneously) from the Batch Synchronization drop-down menu.
The Parallel setting ensures that the step does not execute until all sockets
have reached the step. This ensures that the ambient lighting and temperature
are set before the test is executed by any test socket.
c. Ctrl-click the Set Ambient Temperature and Set Light Intensity steps to select
them.
d. In the Synchronization section of the Properties tab, select One thread only
from the Batch Synchronization drop-down menu.
Use the One thread only setting because the ambient settings need to be
configured only once for all test sockets.
8-34 | ni.com
Developing Test Programs Using TestStand
6. In the Power Output Test sequence, the AC frequency test depends on the power
supply setting in the previous step (Voltage Test). If another socket were to
change the power supply setting before the AC test executed, the AC test would
yield incorrect results. Complete the following steps to use a lock to prevent this
race condition in the Power Output est.
a. In the Power Output Test sequence, insert a lock step before the Voltage Test
step.
Lock Step
Name Lock
Operation Lock
Create the lock if it Place a checkmark in You can also create a lock with a
does not exist the checkbox. separate lock step using the Create
operation.
Unlock Step
Name Unlock
Lock Name "PowerSupply" The lock name is arbitrary, but using an instrument
or Reference resource name is a good way to show that the lock is
Expression reserving that instrument.
8-36 | ni.com
Developing Test Programs Using TestStand
7. Complete the following steps to set the test socket index in the code modules so
that the hardware for each socket measures the corresponding UUT.
a. Update the code module parameter for the Initialize Test Fixture Step.
• On the Module tab, uncheck the Default checkbox for the Test Socket
field.
b. Update the code module parameter for the Resistance Test step.
• In the Solar Panel Output Test sequence, select the Resistance Test step.
• On the Module tab, uncheck the Default checkbox for the Test Socket
field.
Note The simulated driver uses a socket input in all read/write calls to
specify the current test socket from which to measure. In a real test system,
switch hardware is typically used to connect test hardware to the active
UUT.
c. Call the new code module for the Panel Output Voltage Test step to set the
test socket index and configure it as shown in the following table.
• In the Solar Panel Output Test sequence, select the Panel Output Voltage
Test step.
d. Call the new code module for the Voltage Test step to set the test socket index
and configure it as shown in the following table.
• In the Power Output Test sequence, select the Voltage Test step.
e. Call the new code module for the AC Frequency Test step to set the test
socket index and configure it as shown in the following table.
• In the Power Output Test sequence, select the AC Frequency Test step.
Test
1. Test passing UUTs.
c. Enter Golden for both test socket serial numbers and click Go.
8-38 | ni.com
Developing Test Programs Using TestStand
d. Verify that the execution window is split into 2 panes, one for each test
socket.
f. Verify that two temperature monitor graphs appear and show the temperature
data in real time as the test executes.
g. Verify that the result dialog box indicates that both units passed.
e. Verify that the result dialog indicates that socket 0 passed, but socket 1 failed.
Challenge
Execute the test on UUTs 0 – 9, and determine which units are passing.
1. Run the test using Test UUTs to run the test on UUT serial numbers 0 – 9.
Tip Use the report location to review the results for previous tests.
8-40 | ni.com
9 Deploying a
Test Sequence
Activities
+ Additional Deployment Considerations
+ Select the Appropriate Deployment Approach
Exercises
Exercise 9-1 Deploy a Test System
Lesson 9 Deploying a Test Sequence
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _
9-2 | ni.com
Developing Test Programs Using TestStand
Scenario
Test sequences are often developed on one computer and then deployed on a different
one. Once you develop a test program using TestStand, you must package the
program so you can deploy it on the appropriate system.
In this exercise you use the TestStand Deployment Utility to package all the necessary
files to deploy the test program.
Implementation
Note If you have not completed the previous exercise, please refer to the
Course Project Exercise Setup section of the Student Guide.
c. Place a checkmark in the From TestStand Public Directories box to include the
default process models and provided user interfaces.
9-4 | ni.com
Developing Test Programs Using TestStand
3. On the Distributed Files tab, select which files to include in the deployment.
a. Click Yes in the Analyze Source Files dialog box. The analysis finds all required
code modules for sequence files in the deployment.
c. Verify that the code modules and provided code module folders are present
and contain the code modules that the sequence file calls.
4. Click the Save As button and save the deployment configuration as Solar Panel
Test Deployment.tsd in the C:\Exercises\Developing Test Programs.
6. Observe the status log as the build executes. The log indicates the deployment
status and notifies you of any errors that occur.
Test
Complete the following steps to run the sequence file in the image directory.
1. On the System Source tab of TestStand Deployment Utility, click the Explore
button under the Location of Deployable Image section to navigate to the
deployment image.
1 Explore button
2. Navigate to the Solar Panel Test sequence file and open it. The Image directory
contains subfolders that mimic the folders in the original source. In this case, the
sequence file is located in the LabVIEW, CVI, or TestStand Only folder located in
Image\target\Exercises\Developing Test Programs directory.
3. Observe that the paths to the test step code modules have been updated to use
the code module files located in the image directory.
4. Select Execute»Test UUTs and ensure that the sequence runs successfully.
c. Enable the Enable Version Independent Runtime Engine option and click OK.
9-6 | ni.com
Developing Test Programs Using TestStand
6. Select Execute»Test UUTs to ensure that the sequence runs properly using the
LabVIEW Run-Time Engine.
Exercises
Exercise 10-1Using LabVIEW Project
Lesson 10 Using LabVIEW Code Modules with TestStand
Scenario
During this exercise you will create a LabVIEW project for the Solar Panel Test code
modules used in the Solar Panel Test Sequence. As well as you will update the
sequence file to use the project file instead of separate VIs.
Implementation
Note If you have not completed the previous exercise, please refer to the
Course Project Exercise Setup section of the Student Guide.
1. Create a LabVIEW project to organize the code modules used in Solar Panel Test
sequence file.
a. Launch LabVIEW.
10-2 | ni.com
Developing Test Programs Using TestStand
2. Add code modules used in the Solar Panel Test sequence to the created LabVIEW
project.
b. Select the Code Modules folder in the Select a Folder to Insert dialog box.
d. Repeat the steps 2a-2c for the Provided Code Modules folder.
4. Browse for LabVIEW Project for the Solar Panel Test sequence.
a. In TestStand select the Voltage Test step in the Power Output Test sequence.
f. Display the Module tab and select Browse for LabVIEW Project button.
10-4 | ni.com
Developing Test Programs Using TestStand
5. Repeat step 3 for the AC Frequency Test step in the Power Output Test sequence
and Calculate Expected Output and Panel Output Voltage Test steps in the Solar
Panel Output Test sequence.
Tip Tip You can select multiple steps in the same sequence to browse for
a LabVIEW project.
Test
1. Select Execute»Test UUTs.
3. Enter Golden for both test socket serial numbers and click Go.
Topics
+ Test Requirements
+ Solar Panel Output
+ Power Output - DC
+ Power Output - AC
+ System Diagram
Appendix A Solar Panel Testing Requirements
A. Test Requirements
1. The solar panel shall have no visible defects as determined by a test operator.
2. The solar panel controller temperature shall not exceed 62 degrees C while testing.
The worst-case conditions are defined as:
• Input voltage on pin 0 is 10V DC.
• Ambient temperature is 60 degrees C.
3. The solar panel output conforms to the specifications outlined in Section B, Solar
Panel Output.
4. The test sequence shall immediately terminate if the UUT temperature exceeds
62 C.
5. The test sequence shall immediately terminate if the UUT has visible defects.
2. The solar panel shall provide voltage output with the expected outputs in the
conditions in the test matrix below, ± .1V.
Ambient Light
Ambient Temperature (C) (% of 1000 Lumens*) Resulting output Voltage (V)
20 10 .95
60 5.71
100 9.52
40 10 1.11
60 6.69
100 11.14
60 10 1.09
60 6.54
100 10.91
A-2 | ni.com
Developing Test Programs Using TestStand
C. Power Output - DC
1. The DC output (pin 2) shall output 5V ± .05 (1%) when the system voltage is 5V
or greater.
2. The DC output shall output 0V ± .05 when the system voltage is below 5V.
Note The system voltage can be set for testing purposes by supplying
power to the battery terminal (pin 0).
D. Power Output - AC
1. The AC output (pin 3) shall output 120V ± 1.2V (1%) RMS at 60 Hz ± .6 Hz
(1%) when the system voltage is 8V or greater.
2. The AC output shall output 0V ± 1.2V when the system voltage is below 8V.
Note The system voltage can be set for testing purposes by supplying
power to the battery terminal (pin 0).
E. System Diagram
Topics
A. Power Test
B. Guessing Game
C. Message Popup Batch Synchronization
Appendix B Open-Ended Exercises
A. Power Test
Goal
Create a sequence to test if the power (Watts) provided by a UUT meets a specified
condition. You are provided with two numeric values:
• The UUT output voltage (Volts), V
• The resistance of the test fixture (), R
Use these values to calculate the resulting Power, P, using the formula below:
P=V ^2 / R
Pass Fail
Sequence Requirements
• The test sequence must contain one step.
• You must use a LabVIEW or CVI code module to calculate the power value.
• The input values must be configurable as module parameters in the TestStand
step.
Testing
1. Verify that the sequence fails for the following values:
• V=15 V, R=20
2. Verify that the sequence passes for the following values:
• V=16 V, R=32
B-2 | ni.com
Developing Test Programs Using TestStand
B. Guessing Game
Goal
Create a simple guessing game sequence. The sequence must do the following:
1. Generate a random whole number between 1 and 100.
2. Prompt the user to enter a number in a text field of a Message Popup.
3. Tell the user if the number is too high or too low in another Message Popup.
4. Repeat steps 2-3, prompting until the user guesses the correct number.
5. Tell the user that they guessed the correct number.
Hints
• Try to get the sequence working with a constant answer value. Once a constant
value works, use the Round() and Random() expression functions to generate a
whole random number.
• The user response is stored in the Message Popup step properties. Use the
property browser in the Step Properties pane to find the correct property.
• Use the Val() expression function to convert the string input to a numeric value.
• The Break Flow Control step allows you to immediately end a loop.
Challenge
Modify the final message to indicate how many guesses were used.
Testing
1. Verify that the game gives the correct feedback for whether the number is too high
or too low.
2. Verify that the game loops until the user guesses the correct number.
Hints
• Model settings can be set using the ModelOptions callback to override the
configuration in the Model Options dialog box.
• Use the str() expression function to convert a numeric property to a string. Use the
"+" operator to concatenate multiple strings in an expression.
Challenges
• Add a message popup to prompt the user to change the number of test sockets
immediately after they run the sequence
• Configure the Parallel Execution message popups so that they do not all appear in
the same location on the screen
Testing
1. Execute the sequence using Single Pass.
2. Ensure that the "Sequential execution" message appears three times, but only one
message is active at any given time.
3. Ensure that the "One Socket Only" message appears once.
4. Ensure that the "Parallel Execution" messages appear simultaneously and only
after you dismiss the "One Socket Only" message.
B-4 | ni.com
C Additional
Information and
Resources
A. NI Services
To get started, register your product at ni.com/myproducts.
Log in to your National Instruments ni.com User Profile to get personalized access to your
services.
C-2 | ni.com
Developing Test Programs Using TestStand
• Declaration of Conformity (DoC)—A DoC is our claim of compliance with the Council of the
European Communities using the manufacturer’s declaration of conformity. This system
affords the user protection for electromagnetic compatibility (EMC) and product safety. You
can obtain the DoC for your product by visiting ni.com/certification.
For information about other technical support options in your area, visit ni.com/services, or
contact your local office at ni.com/contact.
You also can visit the Worldwide Offices section of ni.com/niglobal to access the branch
office websites, which provide up-to-date contact information, support phone numbers, email
addresses, and current events.
Notes
C-4 | ni.com
Developing Test Programs Using TestStand
Notes
Notes
C-6 | ni.com
Developing Test Programs Using TestStand
Notes
Notes
C-8 | ni.com