100% found this document useful (1 vote)
2K views

Developing Test Programs Using TestStand Exercise Guide PDF

Uploaded by

nanotech11104
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
2K views

Developing Test Programs Using TestStand Exercise Guide PDF

Uploaded by

nanotech11104
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 274

Developing Test

Programs Using
TestStand TM

Exercise Guide
Course Software Version 2017 Service Pack 1 (SP1)
2019 Edition
Part Number 378189A-01

Developing Test Programs Using TestStand

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.

End-User License Agreements and Third-Party Legal Notices


You can find end-user license agreements (EULAs) and third-party legal notices in the following
locations:
• Notices are located in the <National Instruments>\_Legal Information and
<National Instruments> directories.
• EULAs are located in the <National Instruments>\Shared\MDF\Legal\License
directory.
• Review <National Instruments>\_Legal Information.txt for more information on
including legal information in installers built with NI products.
Trademarks
Refer to the NI Trademarks and Logo Guidelines at ni.com/trademarks for more information
on National Instruments trademarks.
ARM, Keil, and µVision are trademarks or registered of ARM Ltd or its subsidiaries.
LEGO, the LEGO logo, WEDO, and MINDSTORMS are trademarks of the LEGO Group.
TETRIX by Pitsco is a trademark of Pitsco, Inc.
FIELDBUS FOUNDATION™ and FOUNDATION™ are trademarks of the Fieldbus Foundation.
EtherCAT® is a registered trademark of and licensed by Beckhoff Automation GmbH.
CANopen® is a registered Community Trademark of CAN in Automation e.V.
DeviceNet™ and EtherNet/IP™ are trademarks of ODVA.
Go!, SensorDAQ, and Vernier are registered trademarks of Vernier Software & Technology.
Vernier Software & Technology and vernier.com are trademarks or trade dress.
Xilinx is the registered trademark of Xilinx, Inc.
Taptite and Trilobular are registered trademarks of Research Engineering & Manufacturing Inc.
FireWire® is the registered trademark of Apple Inc.
Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.
Handle Graphics®, MATLAB®, Real-Time Workshop®, Simulink®, Stateflow®, and xPC
TargetBox® are registered trademarks, and TargetBox™ and Target Language Compiler™ are
trademarks of The MathWorks, Inc.
Tektronix®, Tek, and Tektronix, Enabling Technology are registered trademarks of Tektronix, Inc.
The Bluetooth® word mark is a registered trademark owned by the Bluetooth SIG, Inc.
The ExpressCard™ word mark and logos are owned by PCMCIA and any use of such marks by
National Instruments is under license.
The mark LabWindows is used under a license from Microsoft Corporation. Windows is a
registered trademark of Microsoft Corporation in the United States and other countries.
Other product and company names mentioned herein are trademarks or trade names of their
respective companies.
Members of the National Instruments Alliance Partner Program are business entities independent
from National Instruments and have no agency, partnership, or joint-venture relationship with
National Instruments.

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 Technical Support and Product Information


ni.com

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.

National Instruments Corporate Headquarters


11500 North Mopac Expressway Austin, Texas 78759-3504 USA Tel: 512 683 0100

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

In this student guide, you will learn about the course


description and the items you need to get started in this
course.

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.

This course does not describe the following:

• 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.

C. What You Need to Get Started


Before you use take this course, make sure you have all of the following items:

 Computer running Windows 7

 TestStand 2017 SP1 (32-bit)

 LabVIEW 2018 (32-bit) and/or LabWindows/CVI 2017

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

E. Course Project Exercise Setup


All the exercises in this course project depend on completion of the previous exercise.
If you have not completed any of the exercises, please complete the following steps.
• Before you begin an exercise, copy the solution files for the previous exercise from
the Solutions folder to the appropriate locations in Exercises directory (LabVIEW,
CVI, or TestStand Only).
• Copy the Setup folder from the Solutions folder to the Exercises directory. Run
the setup sequence file located in the C:\Exercises\Developing Test Programs
\Setup directory to set up the search directories.
• 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.

© National Instruments | 7
Student Guide

F. Course Learning Map

8 | ni.com
1 What Is
TestStand?

Describe the purpose of TestStand and the benefits of


using test management software.

Activities
+ Test Executive Requirements Brainstorm
Lesson 1 What Is TestStand?

Activity: Test Executive Requirements Brainstorm


What needs should a test executive satisfy? Fill in your answers below.

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

1-2 | ni.com
2 Creating Test
Sequences

Create a new test sequence to implement a basic test.

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

Activity: Gathering Test Requirements


Use the information from the analysis of the UUT requirements to define a list of all
the aspects of the UUT that you must test to verify the UUT.

For this activity, list only high-level requirements such as hardware, software, and
types of tests.

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

Activity: Define Test Cases


Use the information from the Test Requirements section of the Appendix A of the
exercise guide to define a list of test cases for the UUT.

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

2-2 | ni.com
Developing Test Programs Using TestStand

Exercise 2-1: Create a Test Sequence


Goal
Create a new sequence file to test a solar panel and controller.

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:

a. C:\Exercises\Developing Test Programs\LabVIEW directory if you will


perform exercises for LabVIEW version.

b. C:\Exercises\Developing Test Programs\CVI directory if you will perform


exercises for CVI version.

c. C:\Exercises\Developing Test Programs\TestStand Only directory if you


will perform exercises for TestStand Only version.

© National Instruments | 2-3


Lesson 2 Creating Test Sequences

3. Double-click Message Popup in the Insertion Palette to add a new message popup
step to the Main step group, as shown below.

1 Select View»Insertion Palette to display the palette, if necessary.

2-4 | ni.com
Developing Test Programs Using TestStand

4. Configure the Message Popup step in the Step Settings pane.

Tip Select View»Step Settings to display the Step Settings pane, if


necessary.

3 4

1 Rename the step Visual Inspection.


2 Enter the following into the Message Expression field of the Text and Buttons tab:
"Inspect all UUT(s) and ensure they are securely attached to the test
fixture. If no issues are found, click OK to continue testing."
3 In the Button 2 field, enter "Cancel".
4 Select Button 2 from the Cancel Button drop-down menu. The Cancel Button refers to
the red X in the upper right-side of the dialog box.

5. Save the sequence file.

Test
1. Select Execute»Run MainSequence to execute the sequence.

2. Confirm that the message popup contains the following items.

• Correct message text

• OK and Cancel buttons

3. Click either the OK or Cancel button to dismiss the dialog box.

© National Instruments | 2-5


Lesson 2 Creating Test Sequences

4. Verify that the execution passed.

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.

5. Press <Ctrl-D> to close the completed execution window.

End of Exercise 2-1

2-6 | ni.com
Developing Test Programs Using TestStand

Activity: Implement Test Code


List the test cases for the project and decide which test step type to use. Include a list
of any data to pass to and from the code module. Refer to the Test Requirements
section in the Appendix A.

Test Case Step Type Data In/Out

© National Instruments | 2-7


Lesson 2 Creating Test Sequences

Exercise 2-2: (LabVIEW) Call a Code Module


Goal
Add steps that complete critical checks on the solar panel controller.

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.

• Setup step group—Typically contains steps that initialize instruments, fixtures, or


a UUT.
• Main step group—Typically contains the bulk of the steps in a sequence, including
the steps that test the UUT.
• Cleanup step group—Typically contains steps that power off or restore the initial
state of instruments, fixtures, and the UUT.

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.

Note The following image is also available in Appendix A, Solar Panel


Testing Requirements.

1 Input voltage on pin 0 is at 10V DC.


2 A K-type thermocouple is connected to channel 10 on the test fixture. The
thermocouple is placed over the board to measure the solar panel controller board
temperature.
3 Resistance from the panel is measured across pins 6 and 7.

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.

© National Instruments | 2-9


Lesson 2 Creating Test Sequences

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.

1. Open the Solar Panel Test sequence in TestStand, if necessary.

2. Add a search directory to allow TestStand to find the Driver Simulation VIs.

a. Select Configure»Search Directories.

b. Click Add.

c. Browse to the C:\Program Files (x86)\National Instruments\<LabVIEW>\


instr.lib\Driver Simulation directory.

d. Click OK. Observe that the directory is added to the search directories table.

e. Enable the Search Subdirectories option.

f. Click OK to dismiss the Edit Search Directories dialog box.

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.

a. To load VIs in TestStand, select Configure»Adapters from the menu.

b. Click the Configure button to open the LabVIEW Adapter Configuration dialog
box.

c. In the LabVIEW Adapter Configuration dialog box, select the LabVIEW


Development System and click OK.

d. Click Done to dismiss the Adapter Configuration dialog box.

© National Instruments | 2-11


Lesson 2 Creating Test Sequences

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.

Initialize DMM Action Step

Name Initialize DMM (Properties tab—General


category)

VI Path Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\<LabVIEW>\
instr.lib\Driver Simulation\DMM\
Initialize DMM.vi

Parameter DMM in—"DMM" (Module tab) The error


configuration error in—Verify that the <Default> out parameter stores the
option is enabled error information in the
error out—Step.Result.Error step error property.
TestStand checks this
property after each step
and reports an error if one
is present.

Initialize Power Supply Action Step

Name Initialize Power Supply (Properties tab—General


category)

VI Path Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\<LabVIEW>\
instr.lib\Driver Simulation\
Power Supply\Initialize PS.vi

Parameter Power Supply in—"PowerSupply" (Module tab)


configuration error in—<Default checkbox>
error out—Step.Result.Error

2-12 | ni.com
Developing Test Programs Using TestStand

Initialize Test Fixture Action Step

Name Initialize Test Fixture (Properties tab—


General category)

VI Path Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\<LabVIEW>\
instr.lib\Driver Simulation\
Fixture\SetUUT.vi

Parameter Serial Number—"Golden" (Module tab) The


configuration Test Socket—<Default checkbox> "Golden" serial
error in—<Default checkbox> number represents a
error out—Step.Result.Error known, passing
UUT. The test
fixture simulation
uses this serial
number to determine
the behavior of the
UUT.

• 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.

© National Instruments | 2-13


Lesson 2 Creating Test Sequences

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.

Shut Down Power Supply Action Step

Name Shut Down Power Supply (Properties tab—General


category)

VI Path Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\<LabVIEW>\
instr.lib\Driver Simulation\
Power Supply\Close PS.vi

Parameter Power Supply in—"PowerSupply" (Module tab)


configuration error in - <Default checkbox>
error out—Step.Result.Error

Shut Down DMM Action Step

Name Shut Down DMM (Properties tab—General


category)

VI Path Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\<LabVIEW>\
instr.lib\Driver Simulation\DMM\
Close DMM.vi

Parameter DMM in—"DMM" (Module tab)


configuration error in - <Default checkbox>
error out—Step.Result.Error

2-14 | ni.com
Developing Test Programs Using TestStand

• Two action steps to shut down the power supply and DMM.

6. Create a Numeric Limit Test step to implement the Resistance test.

a. Insert a Numeric Limit Test step in the Main step group to test the resistance
of the solar panel.

© National Instruments | 2-15


Lesson 2 Creating Test Sequences

b. Configure the Resistance Test as outlined in the following table.

Resistance Test Numeric Limit Step

Name Resistance Test (Properties tab—General


category)

VI Path Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\<LabVIEW>\
instr.lib\Driver Simulation\DMM\
Read Resistance.vi.

Parameter Test Socket—<Default checkbox> (Module tab) The


configuration DMM in—"DMM" Resistance step property
Channel 1—6 is the default data source
Channel 2—7 property, which is
error in—<Default checkbox> compared against the
Resistance—Step.Result.Numeric test limits to determine
error out—Step.Result.Error the step result.
DMM out does not need
any further configuring.

Data Source Data Source Expression— (Data Source tab) You


configuration Step.Result.Numeric can change this field to
configure the data source
to use a different
property to determine the
step result.

Limits Comparison Type—GELE (>= <=) (Limits tab) GELE means


configuration Low—110 greater than or equal to
High—118 and less than or equal to.

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.

a. Add a new Numeric Limit Test in the Main step group.

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.

a. Launch LabVIEW, create a new VI and save it as Controller Board Thermal


Test.vi in the C:\Exercises\Developing Test Programs\LabVIEW\
Code Modules directory.

b. Place a SetEnvironment VI, Generate voltage - DC VI and the Read


Temperature VI from the Driver Simulation library to the block diagram of the
Controller Board Thermal Test VI as shown below.

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

1 SetEnvironment—Sets the ambient temperature of the UUT to the value you


specify.
2 Generate Voltage - DC—Sets the input voltage on the pin you specify.
3 Read Temperature—Measures the temperature of the controller board.
4 Wire the error terminals to enforce execution order and propagate error
information.
An error in control is not needed for TestStand code modules because TestStand
manages code module errors.

© National Instruments | 2-17


Lesson 2 Creating Test Sequences

c. Configure the input and output terminals of the VIs as shown in the following
table.

SetEnvironment VI

1 Set the ambient temperature of the UUT to 60 degrees C.


• Right-click the Setting terminal and create a temperature constant.
• Wire a 60 constant to the Value terminal.

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

1 Configure the Read Temperature VI input terminals.


• DMM in—Right-click the input and select Create»Control.
• Channel—Right-click the input and select Create»Constant. Enter a value of 10.
• Sensor Type—Right-click the input and select Create»Constant. Set the value to
KTypeThermocouple.
2 Create an indicator for the Temperature (C) output. Right-click the terminal and
select Create»Indicator. Rename the indicator Temperature.
3 Right-click the error out and select Create»Indicator.

2-18 | ni.com
Developing Test Programs Using TestStand

d. Configure the connector pane of the VI to match the image below.

e. Add a description to document the VI, by selecting File»VI Properties and


entering the following text in the Documentation category.
After applying maximum voltage and maximum ambient temperature,
measure the temperature of the solar panel controller.

f. Save and close the VI.

9. Configure the Controller Board Thermal Test as outlined in the following table.

Controller Board Thermal Test Numeric Limit Step

Name Controller Board Thermal Test (Properties tab—General


category)

VI Path Navigate to C:\Exercises\ (Module tab) If you get a


Developing Test Programs\LabVIEW\ warning that the VI does
Code Modules\ not reside in a search
Controller Board Thermal Test.vi. directory, select the Use
a relative path for the file
you selected option.

Parameter DMM in—"DMM" (Module tab) You must


configuration Power Supply in—"PowerSupply" uncheck the Default
Line in Voltage—10 checkbox to specify a
Temperature—Step.Result.Numeric value.
error out—Step.Result.Error

Limits Comparison Type—LT (<) (Limits tab) Select LT (<)


configuration Low—62 as the comparison type,
because the temperature
must be less than a
specified value.
TestStand uses the Low
field for all comparison
types that have a single
value.

Note If the parameters do not match, double-check the connector pane in


the VI you created.

10. Save the sequence.

© National Instruments | 2-19


Lesson 2 Creating Test Sequences

Test
1. Test a passing UUT:

a. Select Execute»Run MainSequence to execute the sequence.

b. Ensure the initialize and close steps in the setup and cleanup groups complete
with the Done status.

c. Verify that the Thermal Test and Resistance Test pass.

2. Test a Failing UUT:

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.

3. Change the Serial Number back to "Golden".

End of Exercise 2-2 (LabVIEW)

2-20 | ni.com
Developing Test Programs Using TestStand

Exercise 2-2: (LabWindows/CVI) Call a Code Module


Goal
Add steps that complete critical checks on the solar panel controller.

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.

• Setup step group—Typically contains steps that initialize instruments, fixtures, or


a UUT.
• Main step group—Typically contains the bulk of the steps in a sequence, including
the steps that test the UUT.
• Cleanup step group—Typically contains steps that power off or restore the initial
state of instruments, fixtures, and the UUT.

© National Instruments | 2-21


Lesson 2 Creating Test Sequences

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.

Note The following image is also available in Appendix A, Solar Panel


Testing Requirements.

1 Input voltage on pin 0 is at 10V DC.


2 A K-type thermocouple is connected to channel 10 on the test fixture. The
thermocouple is placed over the board to measure the solar panel controller board
temperature.
3 Resistance from the panel is measured across pins 6 and 7.

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.

1. Open the Solar Panel Test sequence in TestStand, if necessary.

2. Add a search directory to allow TestStand to find the driver simulation DLL.

a. Select Configure»Search Directories.

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

e. Enable the Search Subdirectories option.

f. Click OK to dismiss the Edit Search Directories dialog box.

© National Instruments | 2-23


Lesson 2 Creating Test Sequences

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.

Initialize DMM Action Step

Name Initialize DMM (Properties tab—General


category)

Module Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\Shared\CVI\
instr\Driver Simulation\
SimulationDriver.dll
Function: Sim_Dmm_Initialize

Parameter resourceName —"DMM" (Module tab) errorInfo


configuration errorInfo—Step.Result.Error stores the error
information in the step
error property.
TestStand checks this
property after each step
and reports an error if
one is present.

Note If you see a warning icon in the Description field, click the yellow
triangle and select Pointer from the dialog box.

© National Instruments | 2-25


Lesson 2 Creating Test Sequences

Initialize Power Supply Action Step

Name Initialize Power Supply (Properties tab—General


category)

Module Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\Shared\CVI\
instr\Driver Simulation\
SimulationDriver.dll
Function: Sim_PowerSupply_Initialize

Parameter resourceName—"PowerSupply" (Module tab)


configuration errorInfo —Step.Result.Error
(Specify as pointer, if necessary.)

Initialize Test Fixture Action Step

Name Initialize Test Fixture (Properties tab—General


category)

Module Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\Shared\CVI\
instr\Driver Simulation\
SimulationDriver.dll
Function: Sim_Fixture_SetUUT

Parameter Serial Number—"Golden" (Module tab) The


configuration socketIndex—Enter 0 "Golden" serial number
errorInfo—Step.Result.Error represents a known,
(Specify as pointer, if necessary.) passing UUT. The test
fixture simulation uses
this serial number to
determine the behavior
of the UUT.

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.

Shut Down Power Supply Action Step

Name Shut Down Power Supply (Properties tab—General


category)

Module Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\Shared\CVI\
instr\Driver Simulation\
SimulationDriver.dll
Function: Sim_PowerSupply_Close

Parameter resourceName—"PowerSupply" (Module tab)


configuration errorInfo—Step.Result.Error
(Specify as pointer, if necessary.)

Shut Down DMM Action Step

Name Shut Down DMM (Properties tab—General


category)

Module Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\Shared\CVI\
instr\Driver Simulation\
SimulationDriver.dll
Function: Sim_Dmm_Close

Parameter resourceName—"DMM" (Module tab)


configuration errorInfo—Step.Result.Error
(Specify as pointer, if necessary.)

© National Instruments | 2-27


Lesson 2 Creating Test Sequences

6. Create a numeric limit step to implement the resistance test.

a. Create a Numeric Limit Test step in the Main step group to test the resistance
of the solar panel.

b. Configure the Resistance Test as outlined in the following table.

Resistance Test Numeric Limit Step

Name Resistance Test (Properties tab—General


category)

Module Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\Shared\CVI\
instr\Driver Simulation\
SimulationDriver.dll
Function: Sim_Dmm_ReadResistance

Parameter resourceName—"DMM" (Module tab) The result


configuration Channel 1—6 step property is the
Channel 2—7 default data source
testSocket—0 property, which is
result—Step.Result.Numeric compared against the
(Specify as pointer, if necessary.) test limits to determine
errorInfo—Step.Result.Error the step result.
(Specify as pointer, if necessary.)

Data Source Data Source Expression— (Data Source tab) You


configuration Step.Result.Numeric can change this field to
configure the data
source to use a different
property to determine
the step result.

Limits Comparison Type—GELE (>= <=) (Limits tab) GELE means


configuration Low—110 greater than or equal to
High—118 and less than or equal
to.

2-28 | ni.com
Developing Test Programs Using TestStand

7. Create a numeric limit step to test the temperature of the controller board.

a. Add a new Numeric Limit Test in the Main step group.

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.

a. In the LabWindows/CVI Development System, create a New»Project from


Template.

b. Configure the new project as described below.

2
3

1. Choose Dynamic-Link Library as a type.


2. Name the project SolarPanelTest.
3. In the Project Folder field, browse to the C:\Exercises\
Developing Test Programs\CVI\Code Modules folder and click OK.

Note The template generates a source file (.c) and a header file (.h).

© National Instruments | 2-29


Lesson 2 Creating Test Sequences

c. Add the library and instrument files for the simulation driver.

• Right-click the project in the project pane and select Add Existing File.

• Navigate to the file C:\Program Files (x86)\National Instruments\


Shared\CVI\instr\Driver Simulation\SimulationDriver.fp.

• Right-click the project in the project pane and select Add Existing File.

• Browse to the file C:\Program Files (x86)\National Instruments\


Shared\CVI\instr\Driver Simulation\SimulationDriver.lib.

• Verify the project files are added.

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 Error is an enumeration defined to match TestStand’s error container


structure.

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.

Tip Press <Ctrl-S> to save changes.

2-30 | ni.com
Developing Test Programs Using TestStand

e. Double-click SolarPanelTest.c to edit the SolarPanelTest source file.

• Move the <utility.h> source file under the “SolarPanelTest.h”.

• Implement the new ControllerBoardThermalTest function to the source file


based on the image below.

• Save changes.

f. Build the code module.

• Select Build»Build to create the DLL file. Verify in the status pane that no
errors occur while building.

• Verify that the DLL is created in the C:\Exercises\Developing Test


Programs\CVI\Code Modules directory.

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.

© National Instruments | 2-31


Lesson 2 Creating Test Sequences

h. Configure the test limits for the step in the Limits tab:

9. Save the sequence.

Test
1. Test a passing UUT.

a. Execute the sequence using Execute»Run MainSequence.

b. Ensure that the Initialize and Shutdown steps in the Setup and Cleanup groups
complete with the Done status.

c. Ensure that both tests passed.

2. Test a Failing UUT.

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.

c. Restore the serial number to "Golden".

End of Exercise 2-2 (LabWindows/CVI)

2-32 | ni.com
Developing Test Programs Using TestStand

Exercise 2-2: (TestStand Only) Call a Code Module


Goal
Add steps that complete critical checks on the solar panel controller.

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.

• Setup step group—Typically contains steps that initialize instruments, fixtures, or


a UUT.
• Main step group—Typically contains the bulk of the steps in a sequence, including
the steps that test the UUT.
• Cleanup step group—Typically contains steps that power off or restore the initial
state of instruments, fixtures, and the UUT.

© National Instruments | 2-33


Lesson 2 Creating Test Sequences

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.

Note The following image is also available in Appendix A, Solar Panel


Testing Requirements.

1 Input voltage on pin 0 is at 10V DC.


2 A K-type thermocouple is connected to channel 10 on the test fixture. The
thermocouple is placed over the board to measure the controller board
temperature.
3 Resistance from the panel is measured across pins 6 and 7.

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.

1. Open the Solar Panel Test sequence in TestStand, if necessary.

2. Add a search directory to allow TestStand to find the Driver Simulation VIs.

a. Select Configure»Search Directories.

b. Click Add.

c. Browse to the C:\Program Files (x86)\National Instruments\<LabVIEW>\


instr.lib\Driver Simulation directory.

d. Click OK. Observe that the directory is added to the search directories table.

e. Place a checkmark in the Search Subdirectories option.

f. Click OK to dismiss the Edit Search Directories dialog box.

© National Instruments | 2-35


Lesson 2 Creating Test Sequences

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.

a. To load VIs in TestStand, select Configure»Adapters from the menu.

b. Click the Configure button to open the LabVIEW Adapter Configuration dialog
box.

c. In the LabVIEW Adapter Configuration dialog box, select the LabVIEW


Development System and click OK.

d. Click Done to dismiss the 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.

Initialize DMM Action Step

Name Initialize DMM (Properties tab—General


category)

VI Path Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\<LabVIEW>\
instr.lib\Driver Simulation\DMM\
Initialize DMM.vi

Parameter DMM in—"DMM" (Module tab) The error


configuration error in—Verify that the Default out parameter stores the
checkbox is enabled. error information in the
error out—Step.Result.Error step error property.
TestStand checks this
property after each step
and reports an error if one
is present.

Initialize Power Supply Action Step

Name Initialize Power Supply (Properties tab—General


category)

VI Path Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\<LabVIEW>\
instr.lib\Driver Simulation\
Power Supply\Initialize PS.vi

Parameter Power Supply in—"PowerSupply" (Module tab)


configuration error in—<Default checkbox>
error out—Step.Result.Error

© National Instruments | 2-37


Lesson 2 Creating Test Sequences

Initialize Test Fixture Action Step

Name Initialize Test Fixture (Properties tab—General


category)

VI Path Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\<LabVIEW>\
instr.lib\DriverSimulation\
Fixture\SetUUT.vi

Parameter Serial Number—"Golden" (Module tab) The


configuration Test Socket—<Default checkbox> "Golden" serial number
error in—<Default checkbox> represents a known,
error out—Step.Result.Error passing UUT. The test
fixture simulation uses
this serial number to
determine the behavior of
the UUT.

• 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.

Shut Down Power Supply Action Step

Name Shut Down Power Supply (Properties tab—General


category)

VI Path Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\<LabVIEW>\
instr.lib\Driver Simulation\Power
Supply\Close PS.vi

Parameter Power Supply in—"PowerSupply" (Module tab)


configuration error in—<Default checkbox>
error out—Step.Result.Error

Shut Down DMM Action Step

Name Shut Down DMM (Properties tab—General


category)

VI Path Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\<LabVIEW>\
instr.lib\Driver Simulation\DMM\
Close DMM.vi

Parameter DMM in—"DMM" (Module tab)


configuration error in—<Default checkbox>
error out—Step.Result.Error

© National Instruments | 2-39


Lesson 2 Creating Test Sequences

• Two action steps to shutdown the power supply and DMM.

6. Create a Numeric Limit Test step to implement the Resistance test.

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

b. Configure the Resistance Test as outlined in the following table.

Resistance Test Numeric Limit Step

Name Resistance Test (Properties tab—General


category)

VI Path Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\<LabVIEW>\
instr.lib\Driver Simulation\DMM\
Read Resistance.vi.

Parameter Test Socket—<Default checkbox> (Module tab) The


configuration DMM in—"DMM" Resistance step property
Channel 1—6 is the default data source
Channel 2—7 property, which is
error in—<Default checkbox> compared against the
Resistance—Step.Result.Numeric test limits to determine
error out—Step.Result.Error the step result.
DMM out does not need
any further configuring.

Data Source Data Source Expression— (Data Source tab) You


configuration Step.Result.Numeric can change this field to
configure the data source
to use a different
property to determine the
step result.

Limits Comparison Type—GELE (>= <=) (Limits tab) GELE means


configuration Low—110 greater than or equal to
High—118 and less than or equal to.

© National Instruments | 2-41


Lesson 2 Creating Test Sequences

7. Create a numeric limit step to test the temperature of the solar panel controller
board.

a. Add a new Numeric Limit Test in the Main step group.

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.

Controller Board Thermal Test Numeric Limit Step

Name Controller Board Thermal Test (Properties tab—General


category)

VI Path Navigate to C:\Exercises\ (Module tab) If you get a


Developing Test Programs\ warning that the VI does
TestStand Only\Code Modules\ not reside in a search
Controller Board Thermal Test.vi. directory, select the Use
a relative path for the file
you selected option.

Parameter DMM in—"DMM" (Module tab) You must


configuration Power Supply in—"PowerSupply" uncheck the Default
Line in Voltage—10 checkbox to specify a
Temperature—Step.Result.Numeric value.
error out—Step.Result.Error

Limits Comparison Type—LT (<) (Limits tab) Select LT (<)


configuration Low—62 as the comparison type,
because the temperature
must be less than a
specified value.
TestStand uses the Low
field for all comparison
types that have a single
value.

9. Save the sequence.

2-42 | ni.com
Developing Test Programs Using TestStand

Test
1. Test a passing UUT:

a. Select Execute»Run MainSequence to execute the sequence.

b. Ensure the initialize and close steps in the setup and cleanup groups complete
with the Done status.

c. Verify that the Thermal Test and Resistance Test pass.

2. Test a Failing UUT:

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.

3. Change the Serial Number back to "Golden".

End of Exercise 2-2 (TestStand Only)

© National Instruments | 2-43


3 Controlling
TestStand
Execution

Modify a test sequence to execute differently depending


on test conditions or settings.

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

Exercise 3-1: (LabVIEW) Create and Use a Local


Variable
Goal
Use local variables and flow control steps to create a test for DC voltage output under
varying input conditions.

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. Create a code module in LabVIEW to implement the Voltage Test step.

a. In LabVIEW, create a new VI and save it as Voltage Output Test.vi in the


C:\Exercises\Developing Test Programs\LabVIEW\Code Modules directory.

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.

© National Instruments | 3-3


Lesson 3 Controlling TestStand Execution

d. Configure the connector pane of the VI to match the image below.

e. Add a description to document the VI, by selecting File»VI Properties and


entering the following text in the Documentation category.
Measures the output DC voltage when providing an input voltage from
the battery pins.

f. Verify that the block diagram is similar to the one below:

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.

1 In the Variables pane, right-click Locals (‘MainSequence’) and select


Insert Local»Number.
2 Name the new variable inputVoltage.
c. Configure the For loop to iterate the new local variable from 0 – 9 with an
increment of 1.

1 Enter 10 in the Number of Loops field.


2 Enter Locals.inputVoltage in Loop Variable field. Locals.inputVoltage is the
variable you just created.

© National Instruments | 3-5


Lesson 3 Controlling TestStand Execution

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.

Determine Expected Result Statement Step

Name Determine Expected Result (Properties tab—General category)

Expression Locals.expectedVoltage = (Expression tab) Use the conditional


(Locals.inputVoltage >= operator to set the expected voltage
5)?5:0 to 5 if the input voltage is 5 or
greater, or to 0 if the input voltage is
less than 5.

The conditional operator, ?: , chooses one of two values depending on the


Boolean value of a condition.

1 Boolean condition that determines which value the expression outputs.


2 Output value if Boolean condition is true.
3 Output value if Boolean condition is false.

Tip The conditional operator in a TestStand expression is similar to the


Select function in LabVIEW.

Figure 3-1. The Select Function in LabVIEW

a. Create the Locals.expectedVoltage variable by right-clicking


Locals.expectedVoltage in the expression and selecting
Create "Locals.expectedVoltage"»Number from the shortcut menu.

Note The Locals.expectedVoltage variable now appears in the Locals


section of the Variables pane.

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.

a. Configure the test step as outlined in the following table.

Voltage Test Numeric Limit Step

Name Voltage Test (Properties tab—


General category)

VI Path Navigate to C:\Exercises\ (Module tab) If you get


Developing Test Programs\LabVIEW\ a warning that the VI
Code Modules\Voltage Output Test.vi does not reside in a
search directory, select
the Use a relative path
for the file you selected
option.

Parameter DMM in—"DMM" (Module tab)


configuration Power Supply in—"PowerSupply"
Line in—Locals.inputVoltage
Output Voltage—Step.Result.Numeric
error out—Step.Result.Error

Limits Comparison Type—EQT (==+/-) (Limits tab) The limits of


configuration Threshold Type—Delta Value this step change based
Nominal Value— on the current test
Locals.expectedVoltage case. Because the
Lower Threshold—0.05 Nominal Value field is
Upper Threshold—0.05 expression, we can use
the expected voltage
local variable to set the
limit dynamically.

© National Instruments | 3-7


Lesson 3 Controlling TestStand Execution

Test
1. Test a passing UUT.

a. Verify that the Serial Number in the Initialize Test Fixture step is "Golden".

b. Execute the sequence using Execute»Run MainSequence.

c. Observe that all iterations of the Voltage Test pass.

2. Test a Failing UUT.

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 using Execute»Run MainSequence.

c. Verify that some iterations of the Voltage Test fail.

d. Change the serial number back to "Golden".

End of Exercise 3-1 (LabVIEW)

3-8 | ni.com
Developing Test Programs Using TestStand

Exercise 3-1: (LabWindows/CVI) Create and Use a


Local Variable
Goal
Use local variables and flow control steps to create a test for DC voltage output under
varying input conditions.

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. Create a code module to implement the Voltage Output Test step.

a. In the LabWindows/CVI development system, open SolarPanelTest.h in the


SolarPanelTest project.

b. Add a new function declaration for the DC voltage test:

c. Open SolarPanelTest.c to implement the function. This function supplies a


specified DC voltage (lineInVoltage), configures the DMM to read a DC voltage,
and takes a DMM measurement:

d. In TestStand navigate to File»Unload All modules to unload the DLL from


TestStand.

© National Instruments | 3-9


Lesson 3 Controlling TestStand Execution

e. Rebuild the DLL.

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.

1 In the Variables pane, right-click Locals (‘MainSequence’) and select


Insert Local»Number.
2 Name the new variable inputVoltage.

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.

1 Enter 10 in the Number of Loops field.


2 Enter Locals.inputVoltage in Loop Variable field. Locals.inputVoltage is the
variable you just created.

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.

© National Instruments | 3-11


Lesson 3 Controlling TestStand Execution

b. Configure the Statement step as outlined in the following table.

Determine Expected Result Statement Step

Name Determine Expected Result (Properties tab—General


category)

Expression Locals.expectedVoltage = (Expression tab) Uses the


(Locals.inputVoltage >= 5)?5:0 conditional operator to set the
expected voltage to 5 if the
input voltage is 5 or greater or 0
if the input voltage is less than
5.

The conditional operator, ?: , chooses one of two values depending on the


Boolean value of a condition.

1 Boolean condition that determines which value the expression outputs.


2 Output value if Boolean condition is true.
3 Output value if Boolean condition is false.

c. Create the Locals.expectedVoltage variable by right-clicking


Locals.ExpectedVoltage in the expression and selecting
Create "Locals.expectedVoltage"»Number from the shortcut menu.

Note The Locals.expectedVoltage variable now appears in the Locals


section of the Variables pane.

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.

b. Configure the test step as outlined in the following table.

Voltage Test Numeric Limit Step

Name Voltage Test (Properties tab—General


category)

Module Navigate to C:\Exercises\ (Module tab) If you get a


Developing Test Programs\CVI\ warning that the VI does
Code Modules\SolarPanelTest.dll not reside in a search
directory, select the Use
Function: VoltageOutputTest a relative path for the file
you selected option.

Parameter dmm—"DMM" (Module tab)


configuration powerSupply—"PowerSupply"
lineInVoltage—Locals.inputVoltage
DCout—Step.Result.Numeric
errorInfo—Step.Result.Error

Limits Comparison Type—EQT (==+/-) (Limits tab) The limits of


configuration Threshold Type—Delta Value this step change based
Nominal Value— on the current test case.
Locals.expectedVoltage Because the Nominal
Lower Threshold—0.05 Value field is expression,
Upper Threshold—0.05 we can use the expected
voltage local variable to
set the limit dynamically.

© National Instruments | 3-13


Lesson 3 Controlling TestStand Execution

Test
1. Test a passing UUT.

a. Verify that the Serial Number in the Initialize Test Fixture step is "Golden".

b. Execute the sequence using Execute»Run MainSequence.

c. Observe that all iterations of the Voltage Test pass.

2. Test a Failing UUT.

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 using Execute»Run MainSequence.

c. Verify that some iterations of the Voltage Test fail.

d. Change the serial number back to "Golden".

End of Exercise 3-1 (LabWindows/CVI)

3-14 | ni.com
Developing Test Programs Using TestStand

Exercise 3-1: (TestStand Only) Create and Use a


Local Variable
Goal
Use local variables and flow control steps to create a test for DC voltage output under
varying input conditions.

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.

© National Instruments | 3-15


Lesson 3 Controlling TestStand Execution

b. Create a new local variable to store the value of the current input voltage
value.

1 In the Variables pane, right-click Locals (‘MainSequence’) and select


Insert Local»Number.
2 Name the new variable inputVoltage.
c. Configure the For loop to iterate the new local variable from 0 – 9 with an
increment of 1.

1 Enter 10 in the Number of Loops field.


2 Enter Locals.inputVoltage in Loop Variable field. Locals.inputVoltage is the
variable you just created.

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.

Determine Expected Result Statement Step

Name Determine Expected Result (Properties tab—General category)

Expression Locals.expectedVoltage = (Expression tab) Use the conditional


(Locals.inputVoltage >= operator to set the expected voltage
5)?5:0 to 5 if the input voltage is 5 or
greater, or to 0 if the input voltage is
less than 5.

The conditional operator, ?: , chooses one of two values depending on the


Boolean value of a condition.

1 Boolean condition that determines which value the expression outputs.


2 Output value if Boolean condition is true.
3 Output value if Boolean condition is false.
a. Create the Locals.expectedVoltage variable by right-clicking
Locals.expectedVoltage in the expression and selecting
Create "Locals.expectedVoltage"»Number from the shortcut menu.

Note The Locals.expectedVoltage variable now appears in the Locals


section of the Variables pane.

© National Instruments | 3-17


Lesson 3 Controlling TestStand Execution

3. Create a numeric limit test within the For loop, after the statement step, to call the
Voltage Output Test code module.

a. Configure the test step as outlined in the following table.

Voltage Test Numeric Limit Step

Name Voltage Test (Properties tab—


General category)

VI Path Navigate to C:\Exercises\ (Module tab) If you get


Developing Test Programs\ a warning that the VI
TestStand Only\Code Modules\ does not reside in a
Voltage Output Test.vi search directory, select
the Use a relative path
for the file you selected
option.

Parameter DMM in—"DMM" (Module tab)


configuration Power Supply in—"PowerSupply"
Line in—Locals.inputVoltage
Output Voltage—Step.Result.Numeric
error out—Step.Result.Error

Limits Comparison Type—EQT (==+/-) (Limits tab) The limits of


configuration Threshold Type—Delta Value this step change based
Nominal Value— on the current test
Locals.expectedVoltage case. Because the
Lower Threshold—0.05 Nominal Value field is
Upper Threshold—0.05 expression, we can use
the expected voltage
local variable to set the
limit dynamically.

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".

b. Execute the sequence using Execute»Run MainSequence.

c. Observe that all iterations of the Voltage Test pass.

2. Test a Failing UUT.

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 using Execute»Run MainSequence.

c. Verify that some iterations of the Voltage Test fail.

d. Change the serial number back to "Golden".

End of Exercise 3-1 (TestStand Only)

© National Instruments | 3-19


Lesson 3 Controlling TestStand Execution

Exercise 3-2: Modify the Post Action Property of a


Step
Goal
Use Step Post Actions to terminate the sequence if a critical failure occurs.

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.

1. Add a Post Action to the Controller Board Thermal Test.

a. Select the Controller Board Thermal Test in the MainSequence window.

b. On the Properties tab, select Post Actions.

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.

a. Select the Visual Inspection step in the MainSequence window.

b. In the Properties tab, select Post actions.

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

First button in the Message Popup window 1

Second button in the Message Popup window 2

Close window button 0

e. Select Terminate execution in the On Condition False drop-down menu.


If a user clicks the OK button (button 1), then the condition
Step.Result.ButtonHit == 1 is true and the sequence goes to the next step.
If the user hits any other button or the close window button, the condition is
false and the sequence terminates.

© National Instruments | 3-21


Lesson 3 Controlling TestStand Execution

3. Save the sequence file.

Test
1. Test a passing UUT.

a. Execute the sequence using Execute»Run MainSequence.

b. Click the OK button when prompted to inspect the UUT.

c. Ensure that the sequence passes.

2. Test a visual inspection failure.

a. Execute the sequence using Execute»Run MainSequence.

b. Click Cancel when prompted to inspect the UUT.

c. Ensure that the sequence terminates.

3. Test a Controller Board Thermal Test failure.

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.

b. Run the test again.

c. Click the OK button when prompted to inspect the UUT.

d. Ensure that the sequence terminates.

4. Change the Serial number back to "Golden".

End of Exercise 3-2

3-22 | ni.com
4 Troubleshooting
Test Sequences

Use built-in TestStand features to identify and fix problems


in a test sequence.

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

Exercise 4-1: (LabVIEW) Troubleshoot a Code Module


Error
Goal
Use TestStand debugging tools to find errors in a provided TestStand sequence file.

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.

a. Open the Computer Motherboard Test Sequence file from the


C:\Exercises\Developing Test Programs\LabVIEW\Exercise 4-1 directory.
This sequence simulates a computer motherboard test.

b. Run the sequence using Execute»Run MainSequence.

c. Observe the step results.

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.

b. Select Execute»Run MainSequence to run the sequence again.


The execution pauses at the breakpoint before executing the step.

c. Click the Step Over (F10) button to run only the Keyboard Test step, then
pause again.

© National Instruments | 4-3


Lesson 4 Troubleshooting Test Sequences

3. In the Step Settings tab for the Keyboard Test step, investigate the parameter
values on the Module tab.

Tip If necessary, select View»Step Settings to display the Step Settings


tab for the Keyboard Test.

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.

b. Click the Resume (F5) button to complete the execution.

c. After the sequence completes, display the Module tab of the Step Settings
window for the Keyboard Test step.

d. Enter Step.Result.Numeric in the Value of the Result parameter.

4. Rerun the sequence to verify the fix.

a. Click the breakpoint icon to remove the breakpoint.

b. Save the sequence.

c. Select Execute»Run MainSequence to run the sequence again and verify that
the Keyboard Test step passes.

5. Set a breakpoint in the Video Test step to investigate it.

a. Click in the white space to the left of the Video Test step to place a breakpoint.

b. Select Execute»Run MainSequence to run the sequence.


The execution pauses at the breakpoint before executing the step.

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.

8. Determine why the VI is not returning the correct value.

a. Observe that the simulated value passed in is correct, but it is not propagating
to the output.

© National Instruments | 4-5


Lesson 4 Troubleshooting Test Sequences

b. Display the block diagram and notice that the VideoValue control is not wired
to the Latency Indicator.

c. Click the Return to Caller button to return to TestStand.

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.

9. Edit the Video Test VI.

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.

d. Save and close the VI.

Test
1. Remove all breakpoints from the sequence.

2. Run the sequence using Execute»Run MainSequence.

3. Verify that all steps pass.

End of Exercise 4-1 (LabVIEW)

4-6 | ni.com
Developing Test Programs Using TestStand

Exercise 4-1: (LabWindows/CVI) Troubleshoot a


Code Module Error
Goal
Use TestStand debugging tools to find errors in a provided TestStand sequence file.

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.

a. Open the Computer Motherboard Test Sequence file from the


C:\Exercises\Developing Test Programs\CVI\Exercise 4-1 directory. This
sequence simulates a computer motherboard test.

b. Run the sequence using Execute»Run MainSequence.

c. Observe the step results.

d. Notice that the Video Test and Keyboard Test steps fail.

© National Instruments | 4-7


Lesson 4 Troubleshooting Test Sequences

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.

b. Select Execute»Run MainSequence to run the sequence again.


The execution pauses at the breakpoint before executing the step.

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.

Tip If necessary, select View»Step Settings to display the Step Settings


tab for the Keyboard Test.

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

b. Click the Resume (F5) button to complete the execution.

c. After the sequence completes, display the Module tab of the Step Settings
window for the Keyboard Test step.

d. Enter Step.Result.Numeric in the Value of the Measurement parameter.

4. Rerun the sequence to verify the fix.

a. Click the breakpoint icon to remove the breakpoint.

b. Save the sequence.

c. Select Execute»Run MainSequence to run the sequence again and verify that
the Keyboard Test step passes.

5. Set a breakpoint in the Video Test step to investigate it.

a. Click in the white space to the left of the Video Test step to place a breakpoint.

b. Select Execute»Run MainSequence to run the sequence.


The execution pauses at the breakpoint before executing the step.

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.

© National Instruments | 4-9


Lesson 4 Troubleshooting Test Sequences

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.

7. Open the code module source code in LabWindows/CVI, and attach CVI to the
TestStand process.

a. In TestStand navigate to File»Unload All modules to unload the DLL from


TestStand.

b. Select the Video Test step, and select the Edit Code button.

c. Rebuild the project by selecting Build»Build.

d. Attach LabWindows/CVI to the TestStand process to enable stepping through


the DLL.

• Select Run»Attach to Process.

• Find SeqEdit.exe in the process list. Click OK.

• LabWindows/CVI is now waiting for TestStand to execute the code


module. Place a breakpoint on the closing bracket of the VideoTest
function. This will allow you to view the values of each variable in the
function.

8. Debug the Video Test code module.

a. Select Execute»Run MainSequence in TestStand to run the sequence again.

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.

c. Observe that the breakpoint has been hit in LabWindows/CVI. Select


Window»Variables and Call Stack to view the values of each variable.

4-10 | ni.com
Developing Test Programs Using TestStand

d. Observe that the correct value of 5 is passed to the VideoValue variable.


Expand the Measurement variable, and observe that the value is incorrectly 0.

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.

g. Click the Continue button to return to TestStand.

9. Edit the Video Test.

a. In LabWindows/CVI, select <<Running>>» Detach from process to allow


editing of the code module.

b. In TestStand, select File»Unload all Modules to unload the DLL from


TestStand.

c. In LabWindows/CVI, add the following line to the video test function:


*measurement = VideoValue;

d. Rebuild the DLL in LabWindows/CVI.

e. Close the LabWindows/CVI.

© National Instruments | 4-11


Lesson 4 Troubleshooting Test Sequences

Test
1. Remove all breakpoints from the sequence.

2. Run the sequence using Execute»Run MainSequence.

3. Verify that all steps pass.

End of Exercise 4-1 (LabWindows/CVI)

4-12 | ni.com
Developing Test Programs Using TestStand

Exercise 4-1: (TestStand Only) Troubleshoot Test


Sequence Errors
Goal
Use TestStand debugging tools to find errors in a provided TestStand sequence file.

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.

a. Open the Computer Motherboard Test Sequence file from the


C:\Exercises\Developing Test Programs\TestStand Only\Exercise 4-1
directory. This sequence simulates a computer motherboard test.

b. Run the sequence using Execute»Run MainSequence.

c. Observe the step results.

d. Notice that the Keyboard Test steps fails.

© National Instruments | 4-13


Lesson 4 Troubleshooting Test Sequences

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.

b. Select Execute»Run MainSequence to run the sequence again.


The execution pauses at the breakpoint before executing the step.

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.

Tip If necessary, select View»Step Settings to display the Step Settings


tab for the Keyboard Test.

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.

b. Click the Resume (F5) button to complete the execution.

c. After the sequence completes, display the Module tab of the Step Settings
window for the Keyboard Test step.

d. Enter Step.Result.Numeric in the Value of the Result parameter.

e. Save and close the sequence.

Test
1. Remove the breakpoint from the sequence.

2. Run the sequence using Execute»Run MainSequence.

3. Verify that the Keyboard Test step passes.

End of Exercise 4-1 (TestStand Only)

© National Instruments | 4-15


5 Reusing Code in
a Sequence

Modify a test sequence to avoid duplicating code and to


make your test sequence more modular and reusable.

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

Exercise 5-1: (LabVIEW) Create and Use a


Subsequence
Goal
Create a subsequence to complete the AC and DC Voltage output tests.

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.

• The AC output is 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).

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

b. Right-click the selection and select New Subsequence from Steps»With


Preview.

c. Rename the subsequence Power Output Test in the New Subsequence From
Selected Steps dialog box.

d. Click OK to dismiss the dialog box.

e. Select View»Sequence File»Sequences to display the Sequences pane if it is


not already displayed.

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.

© National Instruments | 5-3


Lesson 5 Reusing Code in a Sequence

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.

b. Rename the parameter TargetVoltage.


TargetVoltage stores the expected output voltage for each test. For example,
it stores 5V for the DC test, and 120V for the AC Test.

c. Create two additional numeric parameters, OutputCutoff and OutputPin.

1
2

1 OutputCutoff—Represents the minimum input voltage required to supply an


output. The minimum voltage is 5V for a DC test and 8V for AC Test.
2 OutputPin—Represents the UUT pin used to measure the output for the
current test. The fixture measures DC on pin 2 and measures AC on pin 3.

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.

1 Select the Determine Expected Result step.


2 Update the expression by replacing the number 5 constant with the
parameters you just created. The final expression is
Locals.expectedVoltage = (Locals.inputVoltage >=
Parameters.OutputCutoff)?Parameters.TargetVoltage:0

© National Instruments | 5-5


Lesson 5 Reusing Code in a Sequence

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.

a. Select the Voltage Test step.

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.

b. Update the block diagram as shown below.

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.

d. Set the new DMM Channel parameter to Parameters.OutputPin.

e. Change the Signal Type parameter to AC.

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.

a. Configure the test step as outlined in the following table.

AC Frequency Test Numeric Limit Step

Name AC Frequency Test (Properties tab—General


category)

VI Path Navigate to C:\Exercises\ (Module tab) If you get a warning


Developing Test Programs\ that the VI does not reside in a
LabVIEW\Provided Code Modules\ search directory, select the Use
AC Output Frequency Test.vi a relative path for the file you
selected option.

Parameter Scope in—"Scope" (Module tab) Leave Waveform


configuration Frequency—Step.Result.Numeric Data value empty.
error out—Step.Result.Error

Limits Comparison Type—EQT (== +/-) (Limits tab) Right-click


configuration Threshold Type—Percentage Parameters.TargetFrequency
Nominal Value— and select Create
Parameters.TargetFrequency "Parameters.TargetFrequency"»
Lower Threshold—0.99 Number to create the parameter.
Upper Threshold—1.01

© National Instruments | 5-7


Lesson 5 Reusing Code in a Sequence

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.

b. Display the Precondition Builder dialog box.

1 Click the Precondition Builder button to display the Precondition Builder.

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)

© National Instruments | 5-9


Lesson 5 Reusing Code in a Sequence

8. Configure the Sequence Call step for the DC Power Output Test in the
MainSequence as outlined in the following table.

DC Power Output Test Sequence Call Step

Name DC Power Output Test (Properties tab—General


category)

Module Use Current File—Enabled (Module tab) Note that the


Configuration Sequence—Power Output Test sequence parameters appear in
the parameter list after you select
Power Output Test from the
Sequence drop-down menu. Click
the warning icon in front of the
Sequence field.

Parameter TargetVoltage—5 (Module tab)


configuration OutputCutoff—5
OutputPin—2
TargetFrequency—0

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

9. Create the AC Output Power Test sequence call step.

a. Copy and paste the DC Power Output Test.

b. Rename the step AC Power Output Test.

c. Update the parameter configuration for the AC Power Output Test.

AC Power Output Test Sequence Call Step

Name AC Power Output Test (Properties tab—General category)

Parameter TargetVoltage—120 (Module tab)


configuration OutputCutoff—8
OutputPin—3
TargetFrequency—60

© National Instruments | 5-11


Lesson 5 Reusing Code in a Sequence

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.

Initialize Scope Action Step

Name Initialize Scope (Properties tab—


General category)

VI Path Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\<LabVIEW>\
instr.lib\Driver Simulation\
Oscilloscope\Initialize Scope.vi

Parameter Scope in—"Scope" (Module tab)


configuration Error Out—Step.Result.Error

Shut Down Scope Action Step

Name Shut Down Scope (Properties tab—


General category)

VI Path Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\<LabVIEW>\
instr.lib\Driver Simulation\
Oscilloscope\Close Scope.vi

Parameter Scope in—"Scope" (Module tab)


configuration Error Out—Step.Result.Error

Test
1. Test a passing UUT.

a. In the Initialize Test Fixture step, verify that the Serial Number parameter is set
to "Golden".

b. Execute the sequence using Execute»Run MainSequence.

Note You must have MainSequence selected before running.

c. Ensure that the Power Output Test subsequence runs twice: Once for the DC
test and once for the AC test.

d. Ensure that all steps pass.

5-12 | ni.com
Developing Test Programs Using TestStand

2. Test a failing UUT.

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.

c. Change the Serial Number back to "Golden".

End of Exercise 5-1 (LabVIEW)

© National Instruments | 5-13


Lesson 5 Reusing Code in a Sequence

Exercise 5-1: (LabWindows/CVI) Create and Use a


Subsequence
Goal
Create a subsequence to complete the AC and DC Voltage output tests.

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.

• The AC output is 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).

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

b. Right-click the selection and select New Subsequence from Steps»With


Preview.

c. Rename the subsequence Power Output Test in the New Subsequence From
Selected Steps dialog box.

d. Click OK to dismiss the dialog box.

e. Select View»Sequence File»Sequences to display the Sequences pane if it is


not already displayed.

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.

© National Instruments | 5-15


Lesson 5 Reusing Code in a Sequence

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.

b. Rename the parameter TargetVoltage.


TargetVoltage stores the expected output voltage for each test. For example,
it stores 5V for the DC test, and 120V for the AC Test.

c. Create two additional numeric parameters, OutputCutoff and OutputPin.

1 OutputCutoff—Represents the minimum input voltage required to supply an


output. The minimum voltage is 5V for a DC test and 8V for AC Test.
2 OutputPin—Represents the UUT pin used to measure the output for the
current test. The fixture measures DC on pin 2 and measures AC on pin 3.

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.

1 Select the Determine Expected Result step.


2 Update the expression by replacing the number 5 constant with the
parameters you just created. The final expression is
Locals.expectedVoltage = (Locals.inputVoltage >=
Parameters.OutputCutoff)?Parameters.TargetVoltage:0

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.

a. Select the Voltage Test step.

b. On the Limits tab, replace the constant, .05, with the following expression.
Parameters.TargetVoltage*.01.

© National Instruments | 5-17


Lesson 5 Reusing Code in a Sequence

5. Update the voltage output test code module in LabWindows/CVI to support the AC
and DC Output Frequency Test steps.

a. Open the SolarPanelTest.prj from the C:\Exercises\


Developing Test Programs\CVI\Code Modules directory.

b. In the SolarPanelTest.c file, locate the VoltageOutputTest function, add an int


parameter named DMMChannel before lineInVoltage, and change DCout to
ACout:
void VoltageOutputTest (char* dmm, char* powerSupply, int DMMChannel,
double lineInVoltage, double* ACout, Error* errorInfo)

c. In the Sim_Dmm_Configure function, change the mode to AC:


Sim_Dmm_Configure(dmm, AC, errorInfo);

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);

e. Make the corresponding change to the function in the SolarPanelTest.h file:

6. Build the DLL.

7. In TestStand, update the Voltage Test step.

a. Select the Module tab and click the Reload Prototype button.

b. Set the new DMM Channel parameter to Parameters.OutputPin.

c. Clear all unmapped arguments to remove DCOut.

5-18 | ni.com
Developing Test Programs Using TestStand

d. Set ACout to Step.Result.Numeric.

8. Create a new function in the .c file to test the AC test frequency.

9. Add a function declaration to the .h file:

10. Build the DLL.

11. When you are prompted to include analysis.h, click Yes to add this statement to
the top of the file.

12. Click Build again to include the analysis.h file.

© National Instruments | 5-19


Lesson 5 Reusing Code in a Sequence

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.

b. Name the variable waveformData.

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.

a. Configure the test step as outlined in the following table.

AC Frequency Test Numeric Limit Step

Name AC Frequency Test (Properties tab—General


category)

Module Navigate to C:\Exercises\ (Module tab)


Developing Test Programs\CVI\
Code Modules\SolarPanelTest.dll

Function: ACFrequencyTest

Parameter scope—"Scope" (Module tab) For the


configuration frequency—Step.Result.Numeric waveformData click the Array in
waveformData— the Specify Parameter as Array
Locals.waveformData or Pointer dialog box.
errorInfo—Step.Result.Error

Limits Comparison Type—EQT (== +/-) (Limits tab) Right-click


configuration Threshold Type—Percentage Parameters.TargetFrequency
Nominal Value— and select Create
Parameters.TargetFrequency "Parameters.TargetFrequency"»
Lower Threshold—0.99 Number to create the parameter.
Upper Threshold—1.01

© National Instruments | 5-21


Lesson 5 Reusing Code in a Sequence

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.

b. Display the Precondition Builder dialog box.

1 Click the Precondition Builder button to display the Precondition Builder.

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)

© National Instruments | 5-23


Lesson 5 Reusing Code in a Sequence

16. Configure the Sequence Call step for the DC Power Output Test in the
MainSequence as outlined in the following table.

DC Power Output Test Sequence Call Step

Name DC Power Output Test (Properties tab—General


category)

Module Use Current File—Enabled (Module tab) Note that the


Configuration Sequence—Power Output Test sequence parameters appear in
the parameter list after you
select Power Output Test from
the Sequence drop-down
menu. Click the warning icon
in front of the Sequence field.

Parameter TargetVoltage—5 (Module tab)


configuration OutputCutoff—5
OutputPin—2
TargetFrequency—0

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

17. Create the AC Output Power Test sequence call step.

a. Copy and paste the DC Power Output Test.

b. Rename the step AC Power Output Test.

c. Update the parameter configuration for the AC Power Output Test.

AC Power Output Test Sequence Call Step

Name AC Power Output Test (Properties tab—General category)

Parameter TargetVoltage—120 (Module tab)


configuration OutputCutoff—8
OutputPin—3
TargetFrequency—60

© National Instruments | 5-25


Lesson 5 Reusing Code in a Sequence

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.

Initialize Scope Action Step

Name Initialize Scope (Properties tab—


General category)

Module Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\Shared\CVI\
instr\DriverSimulation\
SimulationDriver.dll
Function: Sim_Scope_Initialize

Parameter resourceName—"Scope" (Module tab)


configuration errorInfo—Step.Result.Error

Shut Down Scope Action Step

Name Shut Down Scope (Properties tab—


General category)

Module Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\Shared\CVI\
instr\DriverSimulation\
SimulationDriver.dll
Function: Sim_Scope_Close

Parameter resourceName—"Scope" (Module tab)


configuration errorInfo—Step.Result.Error

Test
1. Test a passing UUT.

a. In the Initialize Test Fixture step, verify that the Serial Number parameter is set
to "Golden".

b. Execute the sequence using Execute»Run MainSequence.

Note You must have MainSequence selected before running.

c. Ensure that the Power Output Test subsequence runs twice: Once for the DC
test and once for the AC test.

d. Ensure that all steps pass.

5-26 | ni.com
Developing Test Programs Using TestStand

2. Test a failing UUT.

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.

c. Change the Serial Number back to "Golden".

End of Exercise 5-1 (LabWindows/CVI)

© National Instruments | 5-27


Lesson 5 Reusing Code in a Sequence

Exercise 5-1: (TestStand Only) Create and Use a


Subsequence
Goal
Create a subsequence to complete the AC and DC Voltage output tests.

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.

• The AC output is 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).

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

b. Right-click the selection and select New Subsequence from Steps»With


Preview.

c. Rename the subsequence Power Output Test in the New Subsequence From
Selected Steps dialog.

d. Click OK to dismiss the dialog.

e. Select View»Sequence File»Sequences to display the Sequences pane if it is


not already displayed.

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.

© National Instruments | 5-29


Lesson 5 Reusing Code in a Sequence

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.

b. Rename the parameter TargetVoltage.


TargetVoltage stores the expected output voltage for each test. For example,
it stores 5V for the DC test, and 120V for the AC Test.

c. Create two additional numeric parameters, OutputCutoff and OutputPin.

1
2

1 OutputCutoff—Represents the minimum input voltage required to supply an


output. The minimum voltage is 5V for a DC test and 8V for AC Test.
2 OutputPin—Represents the UUT pin used to measure the output for the
current test. The fixture measures DC on pin 2 and measures AC on pin 3.

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.

1 Select the Determine Expected Result step.


2 Update the expression by replacing the number 5 constant with the
parameters you just created. The final expression is
Locals.expectedVoltage = (Locals.inputVoltage >=
Parameters.OutputCutoff)?Parameters.TargetVoltage:0

© National Instruments | 5-31


Lesson 5 Reusing Code in a Sequence

4. Change the tolerance for 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.

a. Select the Voltage Test step.

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.

Voltage Test Numeric Limit Step

VI Path Navigate to C:\Exercises\ (Module tab) If you get a


Developing Test Programs\ warning that the VI does
TestStand Only\Code Modules\5-1\ not reside in a search
Voltage Output Test.vi directory, select the Use
a relative path for the
file you selected option.

Parameter DMM Channel—Parameters.OutputPin (Module tab)


configuration Signal Type—AC
error out—Step.Result.Error

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.

a. Configure the test step as outlined in the following table.

AC Frequency Test Numeric Limit Step

Name AC Frequency Test (Properties tab—General


category)

VI Path Navigate to C:\Exercises\ (Module tab) If you get a warning


Developing Test Programs\ that the VI does not reside in a
TestStand Only\Code Modules\ search directory, select the Use
AC Output Frequency Test.vi a relative path for the file you
selected option.

Parameter Scope in—"Scope" (Module tab) Leave Waveform


configuration Frequency—Step.Result.Numeric Data value empty.
error out—Step.Result.Error

Limits Comparison Type—EQT (== +/-) (Limits tab) Right-click


configuration Threshold Type—Percentage Parameters.TargetFrequency
Nominal Value— and select Create
Parameters.TargetFrequency "Parameters.TargetFrequency"»
Lower Threshold—0.99 Number to create the parameter.
Upper Threshold—1.01

© National Instruments | 5-33


Lesson 5 Reusing Code in a Sequence

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.

b. Display the Precondition Builder dialog box.

1 Click the Precondition Builder button to display the Precondition Builder.

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)

© National Instruments | 5-35


Lesson 5 Reusing Code in a Sequence

8. Configure the Sequence Call step for the DC Power Output Test in the
MainSequence as outlined in the following table.

DC Power Output Test Sequence Call Step

Name DC Power Output Test (Properties tab—General


category)

Module Use Current File—Enabled (Module tab) Note that the


Configuration Sequence—Power Output Test sequence parameters appear in
the parameter list after you select
Power Output Test from the
Sequence drop-down menu. Click
the warning icon in front of the
Sequence field.

Parameter TargetVoltage—5 (Module tab)


configuration OutputCutoff—5
OutputPin—2
TargetFrequency—0

a. Verify the configuration of the DC Power Output Test sequence call as shown
in the following figure.

9. Create the AC Output Power Test sequence call step.

a. Copy and paste the DC Power Output Test.

5-36 | ni.com
Developing Test Programs Using TestStand

b. Rename the step AC Power Output Test.

c. Update the parameter configuration for the AC Power Output Test.

AC Power Output Test Sequence Call Step

Name AC Power Output Test (Properties tab—General category)

Parameter TargetVoltage—120 (Module tab)


configuration OutputCutoff—8
OutputPin—3
TargetFrequency—60

© National Instruments | 5-37


Lesson 5 Reusing Code in a Sequence

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.

Initialize Scope Action Step

Name Initialize Scope (Properties tab—


General category)

VI Path Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\<LabVIEW>\
instr.lib\Driver Simulation\
Oscilloscope\Initialize Scope.vi

Parameter Scope in—"Scope" (Module tab)


configuration Error Out—Step.Result.Error

Shut Down Scope Action Step

Name Shut Down Scope (Properties tab—


General category)

VI Path Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\<LabVIEW>\
instr.lib\Driver Simulation\
Oscilloscope\Close Scope.vi

Parameter Scope in—"Scope" (Module tab)


configuration Error Out—Step.Result.Error

Test
1. Test a passing UUT.

a. In the Initialize Test Fixture step, verify that the Serial Number parameter is set
to "Golden".

b. Execute the sequence using Execute»Run MainSequence.

Note You must have MainSequence selected before running.

c. Ensure that the Power Output Test subsequence runs twice: Once for the DC
test and once for the AC test.

d. Ensure that all steps pass.

5-38 | ni.com
Developing Test Programs Using TestStand

2. Test a failing UUT.

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.

c. Change the Serial Number back to "Golden".

End of Exercise 5-1 (TestStand Only)

© National Instruments | 5-39


Lesson 5 Reusing Code in a Sequence

Exercise 5-2: Create and Use a Global Variable


Goal
Manage resource names in a centralized location using a FileGlobal variable.

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.

1. Add a new FileGlobal variable to manage instrument names.

a. Right-click the FileGlobals section in the Variables pane and select


Insert FileGlobal»Container.

b. Name the variable Instruments.

2. Add three string fields within the new variable.

• 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.

b. In the Find field enter "DMM" in quotes.

c. Click Find/Replace.

1 2

1 The Location field indicates where the match was found


2 The Value field indicates the full value of the match.
3 You can double click each result to navigate to the match.

d. In the Replace With field, enter FileGlobals.Instruments.DMM.

e. Click the Replace Found Text button to replace each match. The Value field
updates as you replace each item.

4. Repeat the step 3 for Power Supply and Scope.

a. Replace "PowerSupply" with FileGlobals.Instruments.PowerSupply.

b. Replace "Scope" with FileGlobals.Instruments.Scope.

© National Instruments | 5-41


Lesson 5 Reusing Code in a Sequence

Test
1. Test a passing UUT.

a. Execute the sequence using Execute»Run MainSequence.

b. Ensure that all steps pass.

2. Test the sequence with a new instrument name.

a. Set the value of the DMM field of the Instruments global to "DMM1".

b. Execute the sequence using Execute»Run MainSequence.

Note Verify that MainSequence is selected before clicking Run.

c. Ensure that all steps pass.

d. Reset the value of the DMM field of the Instruments global to "DMM".

End of Exercise 5-2

5-42 | ni.com
Developing Test Programs Using TestStand

Exercise 5-3: (LabVIEW) Create and Use a Custom


Data Type
Goal
Implement a test using a custom data type to store test conditions.

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.

© National Instruments | 5-43


Lesson 5 Reusing Code in a Sequence

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.

a. In MainSequence right-click the Resistance Test and select New Subsequence


from Steps»With Preview.

b. Rename the subsequence Solar Panel Output Test in the New Subsequence
From Selected Steps dialog box.

c. Click OK to dismiss the dialog box.

d. Select View»Sequence File»Sequences to display the Sequences pane if it is


not already displayed.

e. Configure the Sequence Call step in the MainSequence as outlined in the


following table.

Solar Panel Output Test Sequence Call Step

Name Solar Panel Output Test (Properties tab)

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.

Note You do not terminate the sequence on a Resistance Test failure


because you still want to execute tests for the other components in the
UUT.

© National Instruments | 5-45


Lesson 5 Reusing Code in a Sequence

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.

1 LightIntensity—Insert Local»Array of»Number with an Upper Bounds of 2.


Name the new variable LightIntensity.
2 Set the values of the array elements to 10, 60, and 100 to cover the light
intensity test cases specified in the requirements document (Appendix A).

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.

a. Select View»Types to display the Types pane.

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.

d. Configure the container as shown in the following image.

1 Rename the data type SolarPanelSettings.


2 Expand the container and add two numeric fields:
Temperature and LightIntensity.

© National Instruments | 5-47


Lesson 5 Reusing Code in a Sequence

e. Configure the SolarPanelSettings type to be compatible with LabVIEW


clusters.

1 Right-click the SolarPanelSettings type and select Properties to display the


SolarPanelSettings Properties dialog box.
2 On the Cluster Passing tab, place a enable the Allow Objects of this type to be
Passed as LabVIEW Clusters option so you can pass instances of the data type to
cluster parameters in code modules.
3 Verify that the Property drop-down menu contains Temperature and
LightIntensity items.
4 Specify the name of the cluster element to which TestStand maps the property.

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.

h. Save and close the Types view.

5-48 | ni.com
Developing Test Programs Using TestStand

6. Create a local variable instance of the SolarPanelSettings data type. As the


sequence iterates over each case, this variable will contain the settings for the
active test case.

a. Right-click Locals (‘Solar Panel Output Test’) and select Insert Local»Type»
SolarPanelSettings.

b. Name the variable CurrentTestCase.

c. Observe that the new variable is populated with the fields you defined in the
Types view.

© National Instruments | 5-49


Lesson 5 Reusing Code in a Sequence

1 2

1 Step 7 creates the loop to vary the temperature.


2 Step 8 creates the loop to vary light intensity.

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

c. Set the Current Element field to Locals.CurrentTestCase.Temperature. On


each loop iteration, this field will be updated to the next element in the array.

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.

c. Set the Current Element field to Locals.CurrentTestCase.LightIntensity.

© National Instruments | 5-51


Lesson 5 Reusing Code in a Sequence

1 Step 9 creates the action step to set the ambient temperature.


2 Step 10 creates the action step to set the light intensity.

9. Create an action step to set the ambient temperature within the outer For Each
loop but before the inner For Each loop.

Set Ambient Temperature Action Step

Name Set Ambient Temperature (Properties tab—


General category)

VI Path Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\<LabVIEW>\
instr.lib\Driver Simulation\
Fixture\SetEnvironment.vi

Parameter Setting—"Temperature" (Module tab) You can


configuration Value— select Temperature
Locals.CurrentTestCase.Temperature from the Value
error out—Step.Result.Error drop-down menu for
Setting.

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.

Set Light Intensity Action Step

Name Set Light Intensity (Properties tab—


General category)

VI Path Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\<LabVIEW>\
instr.lib\Driver Simulation\
Fixture\SetEnvironment.vi

Parameter Setting—"Light Intensity" (Module tab) You


configuration Value— can select Light
Locals.CurrentTestCase.LightIntensity Intensity from the
error out—Step.Result.Error Value drop-down
menu for Setting.

© National Instruments | 5-53


Lesson 5 Reusing Code in a Sequence

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.

Calculate Expected Voltage Action Step

Name Calculate Expected Voltage (Properties tab—


General category)

VI Path Navigate to C:\Exercises\ (Module tab) If you get


Developing Test Programs\ a warning that the VI
LabVIEW\Provided Code Modules\ does not reside in a
Calculate Expected Panel Output.vi search directory, select
the Use a relative path
for the file you selected
option.

Parameter PanelTestData— (Module tab) Create the


configuration Locals.CurrentTestCase local variable (number).
ExpectedResult—
Locals.ExpectedPanelOutputVoltage

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

1 Configure VI—Configures the DMM to read either AC or DC voltage.


2 Read Voltage VI—Measures the voltage on the channel you specify.
3 Wire the error terminals to enforce execution order and propagate error
information.

© National Instruments | 5-55


Lesson 5 Reusing Code in a Sequence

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.

d. Configure the connector pane of the VI to match the image below.

e. Add a description to document the VI, by selecting File»VI Properties and


entering the following text in the Documentation category.
Measures the voltage produced by the solar panel after setting the
ambient lighting and temperature conditions.
f. Verify that the block diagram is similar to the one below:

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.

Panel Output Voltage Test Numeric Limit Step

Name Panel Output Voltage Test (Properties tab—General


category)

VI Path Navigate to C:\Exercises\Developing Test Programs\ (Module tab) If you get a


LabVIEW\Code Modules\Panel Output Voltage Test.vi warning that the VI does not
reside in a search directory,
select the Use a relative path
for the file you selected option.

Parameter DMM in—FileGlobals.Instruments.DMM (Module tab)


configuration Voltage—Step.Result.Numeric
error out—Step.Result.Error

Limits Comparison Type—EQT (==+/-) (Limits tab)


configuration Threshold Type— Delta Value
Nominal Value—Locals.ExpectedPanelOutputVoltage
Lower Threshold—0.1
Upper Threshold—0.1

14. Save all the sequences.

© National Instruments | 5-57


Lesson 5 Reusing Code in a Sequence

Test
1. Test a passing UUT.

a. Execute the sequence using Execute»Run MainSequence.

b. Ensure that the Solar Panel Output test passes.

c. Ensure that all steps pass.

2. Test a UUT failing the Resistance Test.

a. In the Initialize Test Fixture step, change the serial number back to
"ResistanceFail". This represents a known bad UUT.

b. Place a breakpoint at the Resistance Test step.

c. Run the test again using Execute»Run MainSequence.

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.

f. Click Resume to finish the execution.

3. Remove the breakpoint from the Resistance Test step.

4. In the Initialize Test Fixture step, change the serial number back to "Golden".

End of Exercise 5-3 (LabVIEW)

5-58 | ni.com
Developing Test Programs Using TestStand

Exercise 5-3: (LabWindows/CVI) Create and Use a


Custom Data Type
Goal
Implement a test using a custom data type to store test conditions.

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.

© National Instruments | 5-59


Lesson 5 Reusing Code in a Sequence

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.

a. In MainSequence right-click the Resistance Test and select New Subsequence


from Steps»With Preview.

b. Rename the subsequence Solar Panel Output Test in the New Subsequence
From Selected Steps dialog.

c. Click OK to dismiss the dialog.

d. Select View»Sequence File»Sequences to display the Sequences pane if it is


not already displayed.

e. Configure the Sequence Call step in the MainSequence as outlined in the


following table.

Solar Panel Output Test Sequence Call Step

Name Solar Panel Output Test (Properties tab)

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.

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.

Note You cannot terminate the sequence on a Resistance Test failure


because you still want to execute tests for the other components in the
UUT.

© National Instruments | 5-61


Lesson 5 Reusing Code in a Sequence

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.

1 LightIntensity—Insert Local»Array of»Number with an Upper Bounds of 2.


Name the new variable LightIntensity.
2 Set the values of the array elements to 10, 60, and 100 to cover the light
intensity test cases specified in the requirements document (Appendix A).

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.

a. Select View»Types to display the Types pane.

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.

d. Configure the container as shown in the following image.

1 Rename the data type SolarPanelSettings.


2 Expand the container and add two numeric fields:
Temperature and LightIntensity.

© National Instruments | 5-63


Lesson 5 Reusing Code in a Sequence

e. Configure the SolarPanelSettings type to be compatible with LabVIEW


clusters.

1 Right-click the SolarPanelSettings type and select Properties to display the


SolarPanelSettings Properties dialog box.
2 On the C Struct Passing tab, enable the Allow Objects of this Type to be Passed
as Structs option so you can pass instances of the data type to cluster parameters
in code modules.
3 Verify that the Property drop-down menu contains Temperature and
LightIntensity items.
4 Select the Cluster Passing tab and enable the Allow Objects of this Types to be
Passed as LabVIEW Clusters option.

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.

h. Save and close the Types view.

5-64 | ni.com
Developing Test Programs Using TestStand

6. Create a local variable instance of the SolarPanelSettings data type. As the


sequence iterates over each case, this variable will contain the settings for the
active test case.

a. Right-click Locals (‘Solar Panel Output Test’) and select Insert Local»Type»
SolarPanelSettings.

b. Name the variable CurrentTestCase.

c. Observe that the new variable is populated with the fields you defined in the
Types view.

© National Instruments | 5-65


Lesson 5 Reusing Code in a Sequence

1
2

1 Step 7 creates the loop to vary the temperature.


2 Step 8 creates the loop to vary light intensity.

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

c. Set the Current Element field to Locals.CurrentTestCase.Temperature. On


each loop iteration, this field will be updated to the next element in the array.

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.

c. Set the Current Element field to Locals.CurrentTestCase.LightIntensity.

© National Instruments | 5-67


Lesson 5 Reusing Code in a Sequence

1 Step 9 creates the action step to set the ambient temperature.


2 Step 10 creates the action step to set the light intensity.

9. Create an action step to set the ambient temperature within the outer For Each
loop but before the inner For Each loop.

Set Ambient Temperature Action Step

Name Set Ambient Temperature (Properties tab—


General category)

Module SimulationDriver.dll (Module tab)


Function: Sim_Fixture_SetAmbientTemperature

Parameter value—Locals.CurrentTestCase.Temperature (Module tab)


configuration errorInfo—Step.Result.Error

10. Create an action step to set the light intensity within the inner For Each loop.

Set Light Intensity Action Step

Name Set Light Intensity (Properties tab—


General category)

Module SimulationDriver.dll (Module tab)


Function: Sim_Fixture_SetAmbientLightIntensity

Parameter value—Locals.CurrentTestCase.LightIntensity (Module tab)


configuration errorInfo—Step.Result.Error

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.

b. Configure the code module as described in the following table.

Calculate Expected Voltage Action Step

Name Calculate Expected Voltage (Properties tab—


General category)

VI Path Navigate to C:\Exercises\Developing Test (Module tab)


Programs\CVI\Provided Code Modules\
Calculate Expected Panel Output.vi

Parameter PanelTestData—Locals.CurrentTestCase (Module tab)


configuration Expected Result— Create the local
Locals.ExpectedPanelOutputVoltage variable (number).

© National Instruments | 5-69


Lesson 5 Reusing Code in a Sequence

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:

b. Declare the function in the SolarPanelTest.h file by adding:

c. Build the DLL.

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.

Panel Output Voltage Test Numeric Limit Step

Name Panel Output Voltage Test (Properties tab—General


category)

Module SolarPanelTest.dll (Module tab) If you get a


Function: PanelOutputVoltageTest warning that the VI does not
reside in a search directory,
select the Use a relative path for
the file you selected option.

Parameter dmm—FileGlobals.Instruemnts.DMM (Module tab)


configuration voltage—Step.Result.Numeric
errorinfo—Step.Result.Error

Limits Comparison Type—EQT (==+/-) (Limits tab)


configuration Threshold Type— Delta Value
Nominal Value—Locals.ExpectedPanelOutputVoltage
Lower Threshold— 0.1
Upper Threshold—0.1

14. Save all the sequences.

Test
1. Test a passing UUT.

a. Execute the sequence using Execute»Run MainSequence.

b. Ensure that the Solar Panel Output test passes.

c. Ensure that all steps pass.

© National Instruments | 5-71


Lesson 5 Reusing Code in a Sequence

2. Test a UUT failing the Resistance Test.

a. In the Initialize Test Fixture step, change the serial number back to
"ResistanceFail". This represents a known bad UUT.

b. Place a breakpoint at the Resistance Test step.

c. Run the test again using Execute»Run MainSequence.

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.

f. Click Resume to finish the execution.

3. Remove the breakpoint from the Resistance Test step.

4. In the Initialize Test Fixture step, change the serial number back to "Golden"

End of Exercise 5-3 (LabWindows/CVI)

5-72 | ni.com
Developing Test Programs Using TestStand

Exercise 5-3: (TestStand Only) Create and Use a


Custom Data Type
Goal
Implement a test using a custom data type to store test conditions.

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.

© National Instruments | 5-73


Lesson 5 Reusing Code in a Sequence

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.

a. In MainSequence right-click the Resistance Test and select New Subsequence


from Steps»With Preview.

b. Rename the subsequence Solar Panel Output Test in the New Subsequence
From Selected Steps dialog.

c. Click OK to dismiss the dialog.

d. Select View»Sequence File»Sequences to display the Sequences pane if it is


not already displayed.

e. Configure the Sequence Call step in the MainSequence as outlined in the


following table.

Solar Panel Output Test Sequence Call Step

Name Solar Panel Output Test (Properties tab)

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.

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.

Note You do not terminate the sequence on a Resistance Test failure


because you still want to execute tests for the other components in the
UUT.

© National Instruments | 5-75


Lesson 5 Reusing Code in a Sequence

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.

1 LightIntensity—Insert Local»Array of»Number with an Upper Bounds of 2.


Name the new variable LightIntensity.
2 Set the values of the array elements to 10, 60, and 100 to cover the light
intensity test cases specified in the requirements document (Appendix A).

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.

a. Select View»Types to display the Types pane.

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.

d. Configure the container as shown in the following image.

1 Rename the data type SolarPanelSettings.


2 Expand the container and add two numeric fields:
Temperature and LightIntensity.

© National Instruments | 5-77


Lesson 5 Reusing Code in a Sequence

e. Configure the SolarPanelSettings type to be compatible with LabVIEW


clusters.

1 Right-click the SolarPanelSettings type and select Properties to display the


SolarPanelSettings Properties dialog box.
2 On the Cluster Passing tab, enable the Allow Objects of this type to be Passed as
LabVIEW Clusters option so you can pass instances of the data type to cluster
parameters in code modules.
3 Verify that the Property drop-down menu contains Temperature and
LightIntensity items.
4 Specify the name of the cluster element to which TestStand maps the property.

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.

h. Save and close the Types view.

5-78 | ni.com
Developing Test Programs Using TestStand

6. Create a local variable instance of the SolarPanelSettings data type. As the


sequence iterates over each case, this variable will contain the settings for the
active test case.

a. Right-click Locals (‘Solar Panel Output Test’) and select Insert Local»Type»
SolarPanelSettings.

b. Name the variable CurrentTestCase.

c. Observe that the new variable is populated with the fields you defined in the
Types view.

© National Instruments | 5-79


Lesson 5 Reusing Code in a Sequence

1
2

1 Step 7 creates the loop to vary the temperature.


2 Step 8 creates the loop to vary light intensity.

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

c. Set the Current Element field to Locals.CurrentTestCase.Temperature. On


each loop iteration, this field will be updated to the next element in the array.

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.

c. Set the Current Element field to Locals.CurrentTestCase.LightIntensity

© National Instruments | 5-81


Lesson 5 Reusing Code in a Sequence

1 Step 9 creates the action step to set the ambient temperature.


2 Step 10 creates the action step to set the light intensity.

9. Create an action step to set the ambient temperature within the outer For Each
loop but before the inner For Each loop.

Set Ambient Temperature Action Step

Name Set Ambient Temperature (Properties tab—


General category)

VI Path Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\<LabVIEW>\
instr.lib\Driver Simulation\
Fixture\SetEnvironment.vi

Parameter Setting—"Temperature" (Module tab) You can


configuration Value— select Temperature
Locals.CurrentTestCase.Temperature from the Value
error out—Step.Result.Error drop-down menu for
Setting.

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.

Set Light Intensity Action Step

Name Set Light Intensity (Properties tab—


General category)

VI Path Navigate to C:\Program Files (x86)\ (Module tab)


National Instruments\<LabVIEW>\
instr.lib\Driver Simulation\
Fixture\SetEnvironment.vi

Parameter Setting—"Light Intensity" (Module tab) You


configuration Value— can select Light
Locals.CurrentTestCase.LightIntensity Intensity from the
error out—Step.Result.Error Value drop-down
menu for Setting.

© National Instruments | 5-83


Lesson 5 Reusing Code in a Sequence

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.

Calculate Expected Voltage Action Step

Name Calculate Expected Voltage (Properties tab—


General category)

VI Path Navigate to C:\Exercises\ (Module tab) If you get


Developing Test Programs\ a warning that the VI
TestStand Only\Code Modules\ does not reside in a
Calculate Expected Panel Output.vi search directory, select
the Use a relative path
for the file you selected
option.

Parameter PanelTestData— (Module tab) Create the


configuration Locals.CurrentTestCase local variable (number).
ExpectedResult—
Locals.ExpectedPanelOutputVoltage

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.

Panel Output Voltage Test Numeric Limit Step

Name Panel Output Voltage Test (Properties tab—


General category)

VI Path Navigate to C:\Exercises\ (Module tab) If you get


Developing Test Programs\ a warning that the VI
TestStand Only\Code Modules\ does not reside in a
Panel Output Voltage Test.vi search directory,
select the Use a
relative path for the
file you selected
option.

Parameter DMM in—FileGlobals.Instruments.DMM (Module tab)


configuration Voltage—Step.Result.Numeric
error out—Step.Result.Error

Limits Comparison Type—EQT (==+/-) (Limits tab)


configuration Threshold Type— Delta Value
Nominal Value—
Locals.ExpectedPanelOutputVoltage
Lower Threshold—0.1
Upper Threshold—0.1

© National Instruments | 5-85


Lesson 5 Reusing Code in a Sequence

13. Save all the sequences.

Test
1. Test a passing UUT.

a. Execute the sequence using Execute»Run MainSequence.

b. Ensure that the Solar Panel Output test passes.

c. Ensure that all steps pass.

2. Test a UUT failing the Resistance Test.

a. In the Initialize Test Fixture step, change the serial number back to
"ResistanceFail". This represents a known bad UUT.

b. Place a breakpoint at the Resistance Test step.

c. Run the test again using Execute»Run MainSequence.

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.

f. Click Resume to finish the execution.

3. Remove the breakpoint from the Resistance Test step.

4. In the Initialize Test Fixture step, change the serial number back to "Golden".

End of Exercise 5-3 (TestStand Only)

5-86 | ni.com
Developing Test Programs Using TestStand

Exercise 5-4: Export and Import Properties


Goal
Use the Property Loader to export a set of properties, modify them and import the
modified ones.

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.

a. Select Tools»Import/Export Properties.

b. Click Export in the left side of the dialog box.

c. Select NI Tab Delimited Text file for the Destination Type option in the Export
Options tab.

d. Browse the C:\Exercises\Developing Test Programs directory for the file


Destination Location and save it as Solar Panel Test.txt.

e. Click Open to dismiss the Open dialog.

f. In the Property Selector tab select the Solar Panel Output Test sequence from
the Select Sequence drop-down menu.

© National Instruments | 5-87


Lesson 5 Reusing Code in a Sequence

g. Navigate to the Properties»Sequences»Solar Panel Output Test»Locals (‘Solar


Panel Output Test’) and check the LightIntensity and Temperature local
variables as shown in the figure below.

h. Click Export to export the properties to the file.

i. Click OK in Export Summary dialog box.

2. Modify the selected properties in the file you specified on the Export Options tab.

a. Open the Solar Panel Test.txt file in the C:\Exercises\Developing Test


Programs directory.

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.

c. Save and close the file.

3. Import the modified properties to the Solar Panel Test Sequence.

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.

c. For the Source Location, navigate to C:\Exercises\Developing Test


Programs\Solar Panel Test.txt.

d. Click Import.

e. Click OK in the Import Summary dialog box.

f. Close the Import/Export Properties dialog box.

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.

© National Instruments | 5-89


Lesson 5 Reusing Code in a Sequence

5. Revert the local variable values back to the original values specified in the
requirements document as shown in the figure below.

End of Exercise 5-4

5-90 | ni.com
6 Storing and
Presenting Test
Results

Use built-in TestStand features to create customized


reports and log data to a database.

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

Activity: Generate a Default Report


Complete the following steps to generate a default report.
1. Open the Solar Panel Test.seq.
2. Generate a report using the Single Pass execution entry point.
3. How many tables are under the Begin Sequence: Solar Panel Test heading?

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

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

Exercise 6-1: Configure Results Collection


Goal
Configure result filtering options and step result recording options to display only
relevant test results in a test report.

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.

a. Select Configure»Result Processing from the menu to display the Result


Processing dialog box.

b. Click the Options button for the Report item.

1 The Options button

© National Instruments | 6-3


Lesson 6 Storing and Presenting Test Results

c. In the Result Filtering Expression field, select Exclude Flow Control from the
drop-down menu.

1 Result Filtering Expression field

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.

e. Click OK to dismiss the Report Options dialog box.

f. Click OK to dismiss the Result Processing dialog box.

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.

• All steps in the setup group.

• All steps in the cleanup group.

b. Display the Properties tab and select Run Options.

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.

a. Calculate Expected Voltage (Solar Panel Output Test Sequence)

b. Determine Expected Result (Power Output Test Sequence)

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.

4. Save the sequences.

© National Instruments | 6-5


Lesson 6 Storing and Presenting Test Results

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.

End of Exercise 6-1

6-6 | ni.com
Developing Test Programs Using TestStand

Exercise 6-2: Configure Report Path Settings


Goal
Configure the report file path settings to change the report file name and place passing
and failing reports in separate locations to make it easier to analyze multiple reports.

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.

1. Complete the following steps to configure the report file path.

a. Select Configure»Result Processing from the menu.

b. Click the Options button in the Report item.

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.

Macro Name Description

$(UserDocumentsDir) Specifies the My Documents folder

$(UUTStatus) Creates a Passed and Failed subfolder to sort reports


based on whether the tests pass or fail.

$(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.

$(Unique) Provides a unique number to prevent report files from


overwriting previous reports.

$(FileExtension) Is the standard file extension for the selected report


format.

© National Instruments | 6-7


Lesson 6 Storing and Presenting Test Results

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

1 Select Specify Report File Path by Expression.


2 Click the down arrow to display a list of available macros.
3 Replace the existing expression with the following expression.
"$(UserDocumentsDir)\\TestStand Reports\\$(UUTStatus)\\
$(UUT)_Report_$(Unique).$(FileExtension)"
4 Inspect the Evaluated Report File path string. This field gives a preview of the file
path.
5 The image reflects how the report files are stored. In this case, the files are stored
in separate subfolders based on whether the UUTs pass or fail.

e. Click OK to close the Report Options dialog box.

f. Click OK to close the Result Processing dialog box.

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.

a. Select the Initialize Test Fixture step in MainSequence.

b. Change the value of the serial number parameter to the following expression.
#NoValidation(RunState.Root.Locals.UUT.SerialNumber)

• The Initialize Test Fixture module using LabVIEW.

• The Initialize Test Fixture module using LabWindows/CVI.

1 RunState.Root—Accesses the process model entry point used to execute the


sequence. The model entry point is unknown until runtime.
2 #NoValidation—Indicates that any error is safe to ignore.
Runstate.Root generates an error indicating that the property does not exist
because RunState.Root is a dynamic value.
3 Locals.UUT.SerialNumber—Looks for a UUT.SerialNumber in the Locals
variables section of the sequence RunState.Root.

© National Instruments | 6-9


Lesson 6 Storing and Presenting Test Results

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.

• Solar Panel Test sequence uses the SequentialModel sequence.

d. Double-click SequentialModel.Seq in the bar to open the process model


sequence so you can view the local variable UUT.SerialNumber.

3. Close the SequentialModel sequence and save the sequences.

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.

c. Ensure that the test sequence passes.

d. Click Stop in the UUT Information dialog box to end testing.

e. Navigate to <Documents>\TestStand Reports, and verify that a Passed folder


is present.

f. Within the Passed folder, verify that a report is present and the filename
contains the serial number Golden.

2. Test a failing UUT.

a. Select Execute»Test UUTs to execute the sequence again.

b. Enter AllFail in the Enter UUT Serial Number field.

c. Ensure that the test sequence fails.

d. Click Stop on the serial number dialog to end testing.

e. Navigate to <Documents>\TestStand Reports, and verify that a Failed folder


is present.

f. Within the Failed folder, verify that a report is present and the filename
contains the serial number AllFail.

End of Exercise 6-2

© National Instruments | 6-11


Lesson 6 Storing and Presenting Test Results

Exercise 6-3: Log Additional Results


Goal
Use Additional Results to log extra test information to the report.

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.

a. In MainSequence, select the Visual Inspection test.

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")

1 Boolean condition determines if the user clicked the OK button.


2 If the user clicks the OK button, no action is taken.
3 Step.Result.ReportText—If the visual inspection fails, a message is added to the
report using the Step.Result.ReportText property.
4 The message in quotes is added to the ReportText property to clarify the
operator’s response.
5 Step.Result.Response—This is the text that the operator enters when the visual
inspection fails.
6 Step.Result.Status—The status of the test step is set to 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.

c. Repeat steps 2a and 2b for the Set Light Intensity 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.

Note TestStand logs array data as a graph by default.

© National Instruments | 6-13


Lesson 6 Storing and Presenting Test Results

c. Configure the report options to display up to 10,000 data points in the graph.

• Select Configure»Result Processing.

• Click the Options button for Report.

• 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.

a. Create a local variable to contain the results for all iterations:

• 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.

• Name the variable Result.

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.

• Rename the step Log Test Result Graph.

• On the Additional Results tab, click the Add Custom Result button to add
a new item to log.

1 The Add Custom Result button

• In the Name field, enter "Power Output Test Results".

• In the Value to Log field, enter Locals.Result to log the new array.

c. Configure the Voltage Test step to use the Result array.

• Select the Voltage Test step.

• 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].

© National Instruments | 6-15


Lesson 6 Storing and Presenting Test Results

• On the Module tab using LabWindows/CVI, change the Value for the
ACout parameter to Locals.Result[Locals.inputVoltage].

Note Use Locals.inputVoltage to index the array so that each test


iteration writes the result to a different array element.

• 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.

5. Save the sequence file.

Test
1. Test a passing UUT.

a. Execute the sequence using Execute»Test UUTs.

b. Enter Golden in the UUT Information dialog box.

c. Ensure that the test passes.

d. Click Stop on the UUT information dialog box to end testing.

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.

2. Test a UUT failing the visual inspection.

a. Execute the sequence using Execute»Test UUTs.

b. Enter Golden in the UUT Information dialog box.

c. When prompted to inspect the UUT, enter some sample text into the text box,
then click Cancel.

d. Verify that the test fails.

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.

End of Exercise 6-3

6-16 | ni.com
Developing Test Programs Using TestStand

Exercise 6-4: Log Results to a Database


Goal
Configure the sequence to use a default schema to log data to a database and review
the results in the Database Viewer.

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.

1. Complete the following steps to configure TestStand to log data to a database.

a. Select Configure»Result Processing from the menu to display the Result


Processing dialog box.

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.

© National Instruments | 6-17


Lesson 6 Storing and Presenting Test Results

f. Verify that Access is selected as a Database Management System for Data


Link Options.

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.

i. Click OK to close the Data Link Properties dialog box.

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.

l. Click OK to dismiss the Database Options dialog.

m. Click OK to dismiss the Result Processing dialog box.

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.

a. Select Execute»Test UUTs from the menu to run the sequence.

b. Enter Golden in the UUT Information dialog box.

c. Ensure that the test passes.

d. Click Stop on the UUT information dialog box to end testing.

e. Open the Database Viewer.

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.

End of Exercise 6-4

© National Instruments | 6-19


7 Executing a Test
Sequence For
Multiple UUTs

Configure a test sequence to test multiple UUTs.

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

Exercise 7-1: Customize Serial Number Entry


Goal
Improve serial number entry by creating a custom dialog box to replace the TestStand
default UUT Information dialog box.

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.

a. Open Solar Panel Test sequence.


a. Right-click in the Sequences pane and select Sequence File Callbacks.

7-2 | ni.com
Developing Test Programs Using TestStand

b. Select the PreUUT callback, then click Add.

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.

© National Instruments | 7-3


Lesson 7 Executing a Test Sequence For Multiple UUTs

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.

Serial Number Dialog Action Step

Name Serial Number Dialog

VI Path For LabVIEW: Navigate to C:\Exercises\


Developing Test Programs\LabVIEW\Provided Code Modules\
Custom Serial Number Dialog.vi.

For CVI: Navigate to C:\Exercises\Developing Test Programs\


CVI\Provided Code Modules\Custom Serial Number Dialog.vi.

For TestStand Only: Navigate to C:\Exercises\


Developing Test Programs\TestStand Only\Code Modules\
Custom Serial Number Dialog.vi.

Parameter Sequence Context In—ThisContext


configuration Automated—False
Continue Testing—Parameters.ContinueTesting
Serial—Parameters.UUT.SerialNumber
error out—Step.Result.Error

ThisContext Use the sequence context to access


TestStand information from within a code
module.

Parameters.ContinueTesting This parameter determines whether to test


another unit or stop the test. If the user click
the Stop button on the dialog, the value of
this parameter is set to false.

Parameters.UUT.SerialNumber This parameter represents the serial number


entered by the operator.

2. Save the sequence.

7-4 | ni.com
Developing Test Programs Using TestStand

Test
1. Test a passing UUT.

a. Execute the sequence using Execute»Test UUTs.

b. Verify that the default serial entry dialog is replaced by the custom dialog,
which provides a drop-down menu containing all available UUTs.

c. Select Golden from the list.

d. Verify the test sequence passed and click OK in the UUT Result dialog box.

e. Click Stop to end the test.

f. Verify that the report indicates the Serial Number is Golden.

End of Exercise 7-1

© National Instruments | 7-5


Lesson 7 Executing a Test Sequence For Multiple UUTs

Exercise 7-2: Execute Steps When the Sequence File


Loads
Goal
Add a message popup that displays when the operator first loads the test sequence to
ensure that all setup tasks are completed.

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.

1. Complete the following steps to add an Engine Callback to display a message


popup upon loading the sequence file.

a. Right-click in the Sequences pane and select Sequence File Callbacks.

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.

d. Select the SequenceFileLoad sequence.

Note The sequence icon is purple to indicate it is an engine callback.

e. Create a Message Popup step in the Main step group of the SequenceFileLoad
sequence.

Test Setup Checklist Message Popup Step

Name Test Setup Checklist

Message "Test Setup checklist:


Expression 1. UUT sockets are undamaged.
2. All test hardware is powered.
3. All other software is closed on the test machine."

2. Save the sequence.

7-6 | ni.com
Developing Test Programs Using TestStand

Test
1. Test that the message appears when loading the sequence file.

a. Save and close the sequence file

b. Reopen the sequence file.

c. Verify that the setup checklist appears.

End of Exercise 7-2

© National Instruments | 7-7


8 Executing Tests
in Parallel

Configure a test sequence to execute tests in parallel to


improve test throughput.

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

Activity: What problems can arise from serial testing?


1. What are some possible problems that could arise from testing UUTs one at a time
on a test station?

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

2. What are some possible solutions to these problems?

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

8-2 | ni.com
Developing Test Programs Using TestStand

Exercise 8-1: Execute a Step Asynchronously


Goal
Use an asynchronous sequence to monitor the UUT temperature throughout the entire
test sequence.

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.

a. Delete the existing Controller Board Thermal Test in the MainSequence.

b. Create a new Sequence Call step at the end of the Setup step group to start
the temperature monitor.

• Configure the sequence call according to the following table.

Initialize Thermal Monitor Sequence Call Step

Name Initialize Thermal Monitor

File For LabVIEW: Navigate to C:\Exercises\


Pathname Developing Test Programs\LabVIEW\Provided Code Modules\
Temperature Monitor.seq
For CVI: Navigate to C:\Exercises\
Developing Test Programs\CVI\Provided Code Modules\
Temperature Monitor.seq
For TestStand Only: Navigate to C:\Exercises\
Developing Test Programs\TestStand Only\Code Modules\
Temperature Monitor.seq

Sequence Start Monitor

Parameter DMM—FileGlobals.Instruments.DMM
configuration MaxTemperature—62

© National Instruments | 8-3


Lesson 8 Executing Tests in Parallel

• Select Use New Thread in the Execution Options field to configure the
sequence to execute in a new thread.

1 Execution Options—Select Use New Thread to run a sequence in a new thread.


2 Sequence Call Advanced Settings button—Use to specify other execution options.

• Click the Advanced Settings button and configure the settings as


described below.

1 Store an Object Reference to the New Thread—Enter Locals.ThermalMonitorThread. You use


Locals.ThermalMonitorThread to ensure that the sequence launched successfully.
2 Right-click Locals.ThermalMonitorThread and select Create»Object Reference. An object reference
variable has different properties than other variables.

• Click Close to close the dialog box.

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.

Shut Down Thermal Monitor Sequence Call Step

Name Shut Down Thermal Monitor

File For LabVIEW: Navigate to C:\Exercises\Developing Test Programs\


Pathname LabVIEW\Provided Code Modules\Temperature Monitor.seq

For CVI: Navigate to C:\Exercises\Developing Test Programs\CVI\


Provided Code Modules\Temperature Monitor.seq

For TestStand Only: Navigate to C:\Exercises\


Developing Test Programs\TestStand Only\Code Modules\
Temperature Monitor.seq

Sequence Shut Down Monitor

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.

© National Instruments | 8-5


Lesson 8 Executing Tests in Parallel

• Configure the Wait step according to the following table.

Get Thermal Monitor Results Wait Step

Name Get Thermal Monitor Results

Wait for Thread (Wait Settings tab) Selecting


Thread configures the step to wait
until the thread you specify
completes.

Specify by Initialize Thermal Monitor (Wait Settings tab)


Sequence
Call

Precondition Locals.ThermalMonitorThread (Properties tab»Preconditions)


Expression != Nothing Ensures results are gathered only if
the Thermal Monitor thread was
started.

Note The constant Nothing in an expression represents a null object value.


In the case of Locals.ThermalMonitorThread, the object is set to a null value
if the thread was never launched.

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.)

2. Save the sequence.

8-6 | ni.com
Developing Test Programs Using TestStand

Test
1. Test a passing UUT.

a. Execute the sequence using Execute»Test UUTs.

b. Select Golden from UUT Serial Number list.

c. Click OK in the Visual Inspection dialog box.

d. Verify that the temperature monitor graph appears and shows the temperature
data in real time as the test executes.

e. Verify that the test sequence passes.

f. Click Stop to end the test.

g. Verify that the temperature data appears in the report under the Monitor
Temperature step.

2. Test a UUT that exceeds the maximum temperature.

a. Execute the sequence using Execute»Test UUTs.

b. Select ThermalFail from UUT Serial Number list.

c. Click OK in the Visual Inspection dialog box.

d. Verify that the sequence terminates when the temperature exceeds the
threshold.

e. Click Stop to end the test.

End of Exercise 8-1

© National Instruments | 8-7


Lesson 8 Executing Tests in Parallel

Exercise 8-2: (LabVIEW) Execute Tests in Parallel


Goal
Use the batch model to test multiple units simultaneously to improve test throughput
and reduce the cost of test.

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.

a. Select Edit»Sequence File Properties.

b. On the Advanced tab, select Require Specific Model from the Model Option
drop-down menu.

c. Select BatchModel.seq from the Model File 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.

1 BatchModel.seq—The process model that the sequence uses.

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.

a. Right-click in the Sequences pane and select Sequence File Callbacks.

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.

Set Number of Sockets Statement Step

Name Set Number of Sockets

Expression Parameters.ModelOptions. Parameters.ModelOptions is


NumTestSockets = 2 provided in the ModelOptions
callback and contains all model
settings.

d. Open the PreUUT sequence.

© National Instruments | 8-9


Lesson 8 Executing Tests in Parallel

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.

Set Number of Sockets Action Step

Name Set Number of Sockets

VI Path Navigate to C:\Program Files (x86)\


National Instruments\<LabVIEW>\
instr.lib\Driver Simulation\Fixture\
SetNumberOfSockets.vi

Parameter Number of Sockets— Number of Sockets


configuration RunState.TestSockets.Count contains the number of test
error out—Step.Result.Error sockets configured in the
ModelOptions callback.

3. Complete the following steps to configure the sequence file to utilize the additional
DMM.

a. In MainSequence, select the Initialize DMM step.

b. Configure the step according to the table below.

Updating the Initialize DMM Step

DMM in—"DMM" + The RunState.TestSockets.MyIndex


Str(RunState.TestSockets.MyIndex) property represents the current test socket.
When the test is executed in batch mode,
this property will be 0 for the first test
socket, and 1 for the second. Therefore,
socket 0 will initialize "DMM0" and socket
1 will initialize "DMM1".

DMM out—FileGlobals.Instruments.DMM FileGlobals.Instruments.DMM sets the


current DMM to the instruments global
variable. Each test socket has a separate
instance of this variable, so setting the
variable from both test sockets will not
conflict.

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.

© National Instruments | 8-11


Lesson 8 Executing Tests in Parallel

5. Complete the following steps to add batch synchronization to synchronize the


Solar Panel Output Test.

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.

b. Configure the lock step according to the following table.

Lock Step

Name Lock

Operation Lock

Lock Name or "PowerSupply" The lock name is arbitrary, but using


Reference an instrument resource name is a
Expression good way to show that the lock is
reserving that instrument.

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.

© National Instruments | 8-13


Lesson 8 Executing Tests in Parallel

c. Create a second Lock step after the AC Frequency test.

d. Configure the lock step according to the following table.

Unlock Step

Name Unlock

Operation Early Unlock By default, a lock automatically unlocks at the end of a


sequence. The Early Unlock operation unlocks the lock
immediately, so that another test socket can enter the
locked section.

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.

• In MainSequence, select the Initialize Test Fixture step.

• On the Module tab, uncheck the Default checkbox for the Test Socket
field.

• Set the value to RunState.TestSockets.MyIndex.

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.

• Set the value to RunState.TestSockets.MyIndex.

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.

• Save and close the VI.

• In TestStand, click the Reload VI Prototype button.

• Set the value of the Socket Index parameter to


RunState.TestSockets.MyIndex.

© National Instruments | 8-15


Lesson 8 Executing Tests in Parallel

d. Update the code module for the Voltage Test step.

• In the Power Output Test sequence, select the Voltage Test step.

• Click the Edit VI button to open the code module

• Right-click the Test Socket input of the Read Voltage VI and select Create»
Control.

• Rename the control Socket Index.

• Wire the Socket Index control to the Test Socket input of the Generate
Voltage - DC VI in addition to the Read Voltage VI.

• Add the control to the VI connector pane.

• Save and close the VI.

• In TestStand, click the Reload VI Prototype button.

• Set the value of the Test Socket parameter to


RunState.TestSockets.MyIndex.

e. Update the code module for the AC Frequency Test step.

• In the Power Output Test sequence, select the AC Frequency Test step.

• Click the Edit VI button to open the code module.

• Right-click the Test Socket input of the readWaveform VI and select


Create»Control.

• Rename the control Socket Index and add the control to the VI connector
pane.

• Save and close the VI.

• In TestStand, click the Reload VI Prototype button.

• Set the value of the Socket parameter to RunState.TestSockets.MyIndex.

f. Save the sequence.

8-16 | ni.com
Developing Test Programs Using TestStand

Test
1. Test passing UUTs.

a. Execute the sequence using Execute»Test UUTs.

b. Leave the Batch Serial Number text box blank.

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.

© National Instruments | 8-17


Lesson 8 Executing Tests in Parallel

e. Click OK in both of the Visual Inspection dialog boxes.

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.

h. Click Next Batch and the Stop to end the test.

2. Test a passing UUT and a failing UUT.

a. Execute the sequence using Execute»Test UUTs.

b. Leave the Batch Serial Number field blank.

c. Enter Golden for socket 0 and AllFail for socket 1.

d. Click Go and continue through the test sequence.

e. Verify that the result dialog indicates that socket 0 passed, but socket 1 failed.

f. Click Next Batch and then Stop to end the test.

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.

2. Determine which units pass and fail.

Tip Use the report location to review the results for previous tests.

End of Exercise 8-2 (LabVIEW)

8-18 | ni.com
Developing Test Programs Using TestStand

Exercise 8-2: (LabWindows/CVI) Execute Tests in


Parallel
Goal
Use the batch model to test multiple units simultaneously to improve test throughput
and reduce the cost of test.

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.

a. Select Edit»Sequence File Properties.

b. On the Advanced tab, select Require Specific Model for the Model Option
drop-down menu.

c. Select BatchModel.seq from the Model File drop-down menu.

© National Instruments | 8-19


Lesson 8 Executing Tests in Parallel

d. Click OK and verify that the Model shown in the status bar is now
BatchModel.seq.

1 BatchModel.seq—The process model that the sequence uses.

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.

a. Right-click in the Sequences pane and select Sequence File Callbacks.

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.

Set Number of Sockets Statement Step

Name Set Number of Sockets

Expression Parameters.ModelOptions. Parameters.ModelOptions is


NumTestSockets = 2 provided in the ModelOptions
callback and contains all model
settings.

d. Open the PreUUT sequence.

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.

Note Select LabWindows/CVI adapter from the Adapter drop-down menu


if necessary.

Set Number of Sockets Action Step

Name Set Number of Sockets Properties Tab

Module SimulationDriver.dll Module Tab


Function:
Sim_Fixture_SetNumberOfSockets

Parameter numberOfSockets— Number of Sockets


configuration RunState.Testsockets.Count contains the number of test
errorInfo—Step.Result.Error sockets configured in the
ModelOptions callback.

3. Complete the following steps to configure the sequence file to utilize the additional
DMM.

a. In MainSequence, select the Initialize DMM step.

b. In the Properties tab, select Expressions and enter the following.

© National Instruments | 8-21


Lesson 8 Executing Tests in Parallel

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

5. Complete the following steps to add batch synchronization to synchronize the


Solar Panel Output Test.

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.

© National Instruments | 8-23


Lesson 8 Executing Tests in Parallel

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.

b. Configure the lock step according to the following table.

Lock Step

Name Lock

Operation Lock

Lock Name or "PowerSupply" The lock name is arbitrary, but using


Reference an instrument resource name is a
Expression good way to show that the lock is
reserving that instrument.

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

c. Create a second Lock step after the AC Frequency test.

d. Configure the lock step according to the following table.

Unlock Step

Name Unlock

Operation Early Unlock By default, a lock automatically


unlocks at the end of a sequence. The
Early Unlock operation unlocks the
lock immediately, so that another test
socket can enter the locked section.

Lock Name or "PowerSupply" The lock name is arbitrary, but using


Reference an instrument resource name is a good
Expression way to show that the lock is reserving
that instrument.

© National Instruments | 8-25


Lesson 8 Executing Tests in Parallel

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.

• In the MainSequence, select 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.

• Open the SolarPanelTest.prj in LabWindows/CVI.

• 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.

• Make the same changes to the functions declarations in the .h file

• Rebuild the DLL.

c. In TestStand, click the Reload Prototype button.

8-26 | ni.com
Developing Test Programs Using TestStand

d. Set the value of the socket parameter to RunState.TestSockets.MyIndex.

e. Repeat the steps 7c and 7d for the Voltage Test and AC Frequency Test steps
in the Power Output Test sequence.

f. Save the sequences.

Test
1. Test passing UUTs.

a. Execute the sequence using Execute»Test UUTs.

b. Leave the Batch Serial Number text box blank.

c. Enter Golden for both test socket serial numbers and click Go.

© National Instruments | 8-27


Lesson 8 Executing Tests in Parallel

d. Verify that the execution window is split into 2 panes, one for each test
socket.

e. Click OK in both of the Visual Inspection dialog boxes.

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.

h. Click Next Batch and the Stop to end the test.

2. Test a passing UUT and a failing UUT.

a. Execute the sequence using Execute»Test UUTs.

b. Leave the Batch Serial Number field blank.

c. Enter Golden for socket 0 and AllFail for socket 1.

d. Click Go and continue through the test sequence.

8-28 | ni.com
Developing Test Programs Using TestStand

e. Verify that the result dialog indicates that socket 0 passed, but socket 1 failed.

f. Click Next Batch and the Stop to end the test.

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.

2. Determine which units pass and fail.

Tip Use the report location to review the results for previous tests.

End of Exercise 8-2 (LabWindows/CVI)

© National Instruments | 8-29


Lesson 8 Executing Tests in Parallel

Exercise 8-2: (TestStand Only) Execute Tests in


Parallel
Goal
Use the batch model to test multiple units simultaneously to improve test throughput
and reduce the cost of test.

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.

a. Select Edit»Sequence File Properties.

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

c. Select BatchModel.seq from the Model File drop-down menu.Click OK and


verify that the Model shown in the status bar is now BatchModel.seq.

1 BatchModel.seq—The process model that the sequence uses.

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.

a. Right-click in the Sequences pane and select Sequence File Callbacks.

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.

Set Number of Sockets Statement Step

Name Set Number of Sockets

Expression Parameters.ModelOptions. Parameters.ModelOptions is


NumTestSockets = 2 provided in the ModelOptions
callback and contains all model
settings.

© National Instruments | 8-31


Lesson 8 Executing Tests in Parallel

d. Open the PreUUT sequence.

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.

Set Number of Sockets Action Step

Name Set Number of Sockets

VI Path Navigate to C:\Program Files (x86)\


National Instruments\<LabVIEW>\
instr.lib\Driver Simulation\
Fixture\SetNumberOfSockets.vi

Parameter Number of Sockets— Number of Sockets


configuration RunState.TestSockets.Count contains the number of test
error out—Step.Result.Error sockets configured in the
ModelOptions callback.

3. Complete the following steps to configure the sequence file to utilize the additional
DMM.

a. In MainSequence, select the Initialize DMM step.

b. Configure the step according to the table below.

Updating the Initialize DMM Step

DMM in—"DMM" + The RunState.TestSockets.MyIndex


Str(RunState.TestSockets.MyIndex) property represents the current test
socket. When the test is executed in
batch mode, this property will be 0 for the
first test socket, and 1 for the second.
Therefore, socket 0 will initialize "DMM0"
and socket 1 will initialize "DMM1".

DMM out—FileGlobals.Instruments.DMM FileGlobals.Instruments.DMM sets the


current DMM to the instruments global
variable. Each test socket has a separate
instance of this variable, so setting the
variable from both test sockets will not
conflict.

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.

© National Instruments | 8-33


Lesson 8 Executing Tests in Parallel

5. Complete the following steps to add batch synchronization to synchronize the


Solar Panel Output Test.

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.

b. Configure the lock step according to the following table.

Lock Step

Name Lock

Operation Lock

Lock Name or "PowerSupply" The lock name is arbitrary, but using


Reference an instrument resource name is a
Expression good way to show that the lock is
reserving that instrument.

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.

© National Instruments | 8-35


Lesson 8 Executing Tests in Parallel

c. Create a second Lock step after the AC Frequency test.

d. Configure the lock step according to the following table.

Unlock Step

Name Unlock

Operation Early Unlock By default, a lock automatically unlocks at the end of a


sequence. The Early Unlock operation unlocks the lock
immediately, so that another test socket can enter the
locked section.

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.

• In MainSequence, select the Initialize Test Fixture step.

• On the Module tab, uncheck the Default checkbox for the Test Socket
field.

• Set the value to RunState.TestSockets.MyIndex.

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.

• Set the value to RunState.TestSockets.MyIndex.

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.

Panel Output Voltage Test Step

VI Path Navigate to C:\Exercises\Developing Test Programs\ (Module tab)


TestStand Only\Code Modules\8-2\
Panel Output Voltage Test.vi

Parameter Socket Index—RunState.TestSockets.MyIndex (Module tab)


configuration

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.

Voltage Test Step

VI Path Navigate to C:\Exercises\Developing Test Programs\ (Module tab)


TestStand Only\Code Modules\8-2\
Voltage Output Test.vi

Parameter Socket Index—RunState.TestSockets.MyIndex (Module tab)


configuration

© National Instruments | 8-37


Lesson 8 Executing Tests in Parallel

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.

Voltage Test Step

VI Path Navigate to C:\Exercises\Developing Test Programs\ (Module tab)


TestStand Only\Code Modules\8-2\
AC Output Frequency Test.vi

Parameter Socket Index—RunState.TestSockets.MyIndex (Module tab)


configuration

f. Save the sequence.

Test
1. Test passing UUTs.

a. Execute the sequence using Execute»Test UUTs.

b. Leave the Batch Serial Number text box blank.

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.

e. Click OK in both of the Visual Inspection dialog boxes.

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.

h. Click Next Batch and the Stop to end the test.

2. Test a passing UUT and a failing UUT.

a. Execute the sequence using Execute»Test UUTs.

b. Leave the Batch Serial Number field blank.

c. Enter Golden for socket 0 and AllFail for socket 1.

d. Click Go and continue through the test sequence.

© National Instruments | 8-39


Lesson 8 Executing Tests in Parallel

e. Verify that the result dialog indicates that socket 0 passed, but socket 1 failed.

f. Click Next Batch and then Stop to end the test.

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.

2. Determine which units pass and fail.

Tip Use the report location to review the results for previous tests.

End of Exercise 8-2 (TestStand Only)

8-40 | ni.com
9 Deploying a
Test Sequence

Describe techniques for developing and deploying code


modules that are specific to the LabVIEW development
environment.

Activities
+ Additional Deployment Considerations
+ Select the Appropriate Deployment Approach

Exercises
Exercise 9-1 Deploy a Test System
Lesson 9 Deploying a Test Sequence

Activity: Additional Deployment Considerations


Generate a list of items in the project that need to be deployed. Use the Identifying
Components to Deploy topic from the NI TestStand Help for items to consider.

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

_ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ __ _ __ _ __ __ _ __ __ _ __ __ _

Activity: Select the Appropriate Deployment Approach


Consider the following scenarios and determine which deployment approach suits the
situation best.

Scenario Components to Deploy Image or Installer?

1. The deployment migrates to a


computer that does not already
have TestStand installed.

2. An existing test station needs


to be updated.

9-2 | ni.com
Developing Test Programs Using TestStand

Exercise 9-1: Deploy a Test System


Goal
Use the TestStand Deployment Utility to create an image containing all the necessary
files to run the test sequence.

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.

1. Select Tools»Deploy TestStand System to launch the TestStand Deployment


Utility
The TestStand Deployment Utility can generate a deployment image or a folder
containing all the files needed for the deployment. The TestStand Deployment
Utility ensures that all code module paths are updated to work correctly in the new
location.

2. On the System Source tab, configure the directory to deploy.

a. Enable the From Directory option.

b. Click the Browse button and select the:

• C:\Exercises\Developing Test Programs\LabVIEW directory for


LabVIEW version.

• C:\Exercises\Developing Test Programs\CVI directory for CVI version.

• C:\Exercises\Developing Test Programs\TestStand Only directory for


TestStand Only version.

© National Instruments | 9-3


Lesson 9 Deploying a Test Sequence

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.

b. Review the files in the files list.

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.

5. Click the Build button to build the deployment.

© National Instruments | 9-5


Lesson 9 Deploying a Test Sequence

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.

5. Configure the LabVIEW adapter to use the LabVIEW Run-Time Engine.

a. Select Configure»Adapters and click the Configure button to open the


LabVIEW Adapter Configuration dialog box.

b. Select the LabVIEW Run-Time Engine option.

c. Enable the Enable Version Independent Runtime Engine option and click OK.

9-6 | ni.com
Developing Test Programs Using TestStand

d. Click OK in the LabVIEW Adapter Message dialog box.

e. Click Done to dismiss the Adapter Configuration dialog box.

6. Select Execute»Test UUTs to ensure that the sequence runs properly using the
LabVIEW Run-Time Engine.

7. Close the sequence file.

End of Exercise 9-1

© National Instruments | 9-7


10 Using LabVIEW
Code Modules
with TestStand

Describe techniques for developing and deploying code


modules that are specific to the LabVIEW development
environment.

Exercises
Exercise 10-1Using LabVIEW Project
Lesson 10 Using LabVIEW Code Modules with TestStand

Exercise 10-1: Using LabVIEW Project


Goal
Create a project for the Solar Panel Test code modules.

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.

b. Select File»Create Project and click Finish to create a LabVIEW project.

c. Save the project as Solar Panel Test.lvproj in the


C:\Exercises\Developing Test Programs\LabVIEW directory.

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.

a. Right click the My Computer and select Add»Folder (Auto-populating) in the


Project Explorer window.

b. Select the Code Modules folder in the Select a Folder to Insert dialog box.

c. Click the Select Folder button to dismiss the dialog.

© National Instruments | 10-3


Lesson 10 Using LabVIEW Code Modules with TestStand

d. Repeat the steps 2a-2c for the Provided Code Modules folder.

e. Save and close the LabVIEW project.

3. Configure the LabVIEW Adapter to run in the LabVIEW Development Environment.

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.

g. Select the Solar Panel Test.lvproj project and click Open.

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.

6. Save the sequence.

Test
1. Select Execute»Test UUTs.

2. Leave the Batch Serial Number text box blank.

3. Enter Golden for both test socket serial numbers and click Go.

4. Click OK in both of the Visual Inspection dialog boxes.

5. Ensure that the sequence runs successfully.

6. Click Next Batch and the Stop to end the test.

End of Exercise 10-1

© National Instruments | 10-5


A Solar Panel
Testing
Requirements

This section specifies the testing requirements for the solar


panels and solar panel controllers. You use these
requirements in several exercises and activities throughout
the course.

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.

B. Solar Panel Output


1. The resistance of the solar panel shall be in a range of 110 to 118 Ohms.

Note Resistance of the panel is measured across pins 6 and 7.

2. The solar panel shall provide voltage output with the expected outputs in the
conditions in the test matrix below, ± .1V.

Note The output voltage of the panel can be measured on pin 6.

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

Note 1000 lumens represents approximately the amount of light provided


by direct sunlight on the one-square foot solar panel.

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

© National Instruments | A-3


B Open-Ended
Exercises

This section contains open-ended practice exercises.

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

Then, determine the test result using the table below:

Pass Fail

8 P  P < 8, P > 9

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.

© National Instruments | B-3


Appendix B Open-Ended Exercises

C. Message Popup Batch Synchronization


Goal
Create a sequence which uses batch synchronization to control the behavior of various
message popups. The sequence must do the following:
1. The sequence must run in three test sockets, regardless of the current model
settings.
2. Display the message "Sequential execution: Socket [socket index]" once for
each test socket, where [socket index] is the zero-based index of the test socket.
Only one message of this type should be displayed at a given time.
3. After the user dismisses all "Sequential execution" messages, display a message
with the text "One Socket Only". This message should be displayed only once.
4. Once the user dismisses the "One Socket Only" message, simultaneously display
a message from each test socket with the text "Parallel Execution: Socket
[socket index]".
5. Once the user dismisses all "Parallel Execution" messages, all sockets should
complete the test.

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

National Instruments provides global services and support


as part of our commitment to your success. Take
advantage of product services in addition to training and
certification programs that meet your needs during each
phase of the application life cycle; from planning and
development through deployment and ongoing
maintenance.
Appendix C Additional Information and Resources

A. NI Services
To get started, register your product at ni.com/myproducts.

As a registered NI product user, you are entitled to the following benefits:


• Access to applicable product services.
• Easier product management with an online account.
• Receive critical part notifications, software updates, and service expirations.

Log in to your National Instruments ni.com User Profile to get personalized access to your
services.

B. Services and Resources


• Maintenance and Hardware Services—NI helps you identify your systems’ accuracy and
reliability requirements and provides warranty, sparing, and calibration services to help you
maintain accuracy and minimize downtime over the life of your system. Visit ni.com/
services for more information.
– Warranty and Repair—All NI hardware features a one-year standard warranty that is
extendable up to five years. NI offers repair services performed in a timely manner by
highly trained factory technicians using only original parts at a National Instruments
service center.
– Calibration—Through regular calibration, you can quantify and improve the
measurement performance of an instrument. NI provides state-of-the-art calibration
services. If your product supports calibration, you can obtain the calibration certificate
for your product at ni.com/calibration.
• System Integration—If you have time constraints, limited in-house technical resources, or
other project challenges, National Instruments Alliance Partner members can help. To learn
more, call your local NI office or visit ni.com/alliance.
• Training and Certification—The NI training and certification program is the most effective
way to increase application development proficiency and productivity. Visit
ni.com/training for more information.
– The Skills Guide assists you in identifying the proficiency requirements of your current
application and gives you options for obtaining those skills consistent with your time
and budget constraints and personal learning preferences. Visit ni.com/
skills-guide to see these custom paths.
– NI offers courses in several languages and formats including instructor-led classes at
facilities worldwide, courses on-site at your facility, and online courses to serve your
individual needs.
• Technical Support—Support at ni.com/support includes the following resources:
– Self-Help Technical Resources—Visit ni.com/support for software drivers and
updates, a searchable KnowledgeBase, product manuals, step-by-step troubleshooting
wizards, thousands of example programs, tutorials, application notes, instrument
drivers, and so on. Registered users also receive access to the NI Discussion Forums at
ni.com/forums. NI Applications Engineers make sure every question submitted online
receives an answer.
– Software Support Service Membership—The Standard Service Program (SSP) is a
renewable one-year subscription included with almost every NI software product,
including NI Developer Suite. This program entitles members to direct access to
NI Applications Engineers through phone and email for one-to-one technical support, as
well as exclusive access to online training modules at ni.com/self-paced-training.
NI also offers flexible extended contract options that guarantee your SSP benefits are
available without interruption for as long as you need them. Visit ni.com/ssp for more
information.

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.

C. Other National Instruments Training Courses


National Instruments offers several training courses for TestStand users. These courses continue
the training you received here and expand it to other areas. Visit ni.com/training to purchase
course materials or sign up for instructor-led, hands-on courses at locations around the world.

D. National Instruments Certification


Earning an NI certification acknowledges your expertise in working with NI products and
technologies. The measurement and automation industry, your employer, clients, and peers
recognize your NI certification credential as a symbol of the skills and knowledge you have
gained through experience. Visit ni.com/training for more information about the
NI certification program.

© National Instruments | C-3


Appendix C Additional Information and Resources

Notes

C-4 | ni.com
Developing Test Programs Using TestStand

Notes

© National Instruments | C-5


Appendix C Additional Information and Resources

Notes

C-6 | ni.com
Developing Test Programs Using TestStand

Notes

© National Instruments | C-7


Appendix C Additional Information and Resources

Notes

C-8 | ni.com

You might also like