NI TestStand TM I: Introduction Course Manual Course Software Version 4.1 February 2009 Edition Part Number 372771A-01 NI TestStand I: Introduction Course Manual Copyright 2009 National Instruments Corporation. 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. Trademarks National Instruments, NI, ni.com, NI TestStand, and LabVIEW are trademarks of National Instruments Corporation. Refer to the Terms of Use section on ni.com/legal for more information about National Instruments trademarks. 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/legal/patents.
Contents Student Guide A. NI Certification...vii B. Course Description...vii C. What You Need to Get Started...viii D. Installing the Course Software...ix E. TestStand Directories...ix F. Course Goals...x G. Course Conventions...x Lesson 1 Introduction to Testing A. Types of Tests...1-2 B. Automated Testing...1-6 C. Test System Terminology...1-7 D. Components of an Automated Test System...1-8 E. Testing Roles...1-9 F. Test System Development Process...1-11 G. Covering and Tracking Requirements...1-13 Lesson 2 Introduction to TestStand A. Role of Test Management Software...2-2 B. TestStand Terminology...2-4 C. TestStand Components...2-11 D. Using the TestStand Sequence Editor...2-16 E. TestStand Execution Architecture...2-24 Lesson 3 Analyzing Sequences A. Debugging and Diagnostics...3-2 B. Informational Tools...3-20 Lesson 4 Creating Sequences A. Overview...4-2 B. Creating Steps...4-4 C. Code Modules...4-32 D. Subsequences...4-41 E. Sequence Properties...4-43 F. Sequence File Properties...4-44 National Instruments Corporation iii NI TestStand I: Introduction Course Manual
Contents Lesson 5 Managing Data A. TestStand Data Layout...5-2 B. Expressions...5-12 C. Custom Data Types...5-17 D. Variables...5-24 E. Importing and Exporting Properties...5-32 Lesson 6 Overriding Callbacks A. Callbacks...6-2 B. Process Model Callbacks...6-4 C. Engine Callbacks...6-7 Lesson 7 Configuring TestStand A. Station Options...7-2 B. Adapter Configuration...7-6 C. Edit Search Directories...7-11 D. Report Options...7-12 E. Database Options...7-17 Lesson 8 Executing Tests in Parallel A. Multi-UUT Testing...8-2 B. Multithreading...8-6 C. Executing Sequences in New Threads...8-10 D. Multithreaded Process Models...8-12 E. Multithreading Caveats...8-22 F. Synchronization Step Types...8-26 Lesson 9 Best Practices for Test Development A. Creating Modular Test Systems...9-2 B. Using Appropriate Data Scope...9-6 C. Using Setup and Cleanup Groups...9-9 D. Handling Non-Product-Specific Operations...9-10 E. Documenting Test Systems...9-11 F. Additional Resources...9-16 NI TestStand I: Introduction Course Manual iv ni.com
Contents Lesson 10 User Management A. TestStand User Management...10-2 B. User Groups...10-4 C. Privileges...10-5 D. Synchronizing with Other User Management Systems...10-9 Lesson 11 Deploying a Test System A. Introduction to Deployment...11-2 B. Deployment Considerations...11-4 C. Deployment Process...11-6 D. Common Deployment Scenarios...11-11 Appendix A Additional Information and Resources Course Evaluation National Instruments Corporation v NI TestStand I: Introduction Course Manual
A. Callbacks Callbacks are optional sequences that allow you to perform actions when certain events occur. The process model and TestStand Engine both define callbacks. Each callback corresponds to a certain point in the execution of a process model or to a certain event that can occur when the TestStand Engine performs operations. For each callback, the process model or TestStand Engine contains a default sequence to execute, although, in many cases, the default sequence is empty. The process model or sequence file can override the default sequence and replace the default actions. Process models override engine callbacks, and sequence files can override process model callbacks or engine callbacks.
Callbacks Creating a Callback Sequence Each sequence file can include sequences that override callbacks. To override a callback within a sequence file, open the sequence file, right-click in the Sequences pane and select Sequence File Callbacks. Select a callback from the available list and click Add. You can also edit or delete existing callbacks. Process model sequence files can also override callbacks. Refer to the NI TestStand II: Customization course for more information about modifying process model sequence files.
B. Process Model Callbacks Process models define process model callbacks, which are sequences that you call as steps in an entry point sequence. You can customize a process model to add new process model callbacks. Client sequence files can override process model callbacks. Examples of process model callbacks in the default SequentialModel process model are MainSequence, PreUUT, and TestReport. Some process model callbacks have default actions associated with them. For example, the TestReport callback generates a report for the test. Overriding a callback that includes default actions disables the default action. For example, if you override the TestReport callback, the SequentialModel generates a test report only if the overridden version of the callback contains the code to do so. Other callbacks do not have default code associated with them. For example, you can override the PreUUT callback to add steps that the process model executes each time a UUT is tested before prompting for the UUT serial number. Another example is the MainSequence callback, which most client sequence files override to define the basic behavior of the test routine.
Process Model and Callbacks Consider two separate client sequence files, Client #1 and Client #2, that use the same process model. Client #1 contains code that reads a serial number from a database, and Client #2 uses the default PreUUT callback that prompts the user to enter the serial number. Client #2 does not display the Pass/Fail banner of the default PostUUT callback, but Client #1 does. Instead of creating two separate process models for each client sequence file, you can use callbacks to implement the unique requirements of each client and use the same process model for the client sequence files. When execution of Client #1 begins, the process model detects that there are two callback sequences within the sequence file PreUUT and MainSequence. When the process model reaches these callbacks, it executes the callback of the client file instead of the callback sequence that the process model defines. Therefore, the default code that displays a serial number dialog box does not appear. Instead, TestStand executes the code contained in the callback. A Pass/Fail banner displays because Client #1 does not override the PostUUT Callback. When execution of Client #2 begins, the process model detects that there are two callback sequences within the client sequence file PostUUT and MainSequence. When the process model reaches these callbacks, it executes the callback of the client sequence file instead of the callback sequence that is defined in the process model. Therefore, the default code that displays the Pass/Fail banner dialog box does not appear. Instead, the code contained in the PostUUT callback executes. Because Client #2 does not override the PreUUT Callback, the user is prompted to enter a serial number.
Contents Lesson 5 Managing Data A. TestStand Data Layout...5-2 B. Expressions...5-12 C. Custom Data Types...5-17 D. Variables...5-24 E. Importing and Exporting Properties...5-32 Lesson 6 Overriding Callbacks A. Callbacks...6-2 B. Process Model Callbacks...6-4 C. Engine Callbacks...6-7 Lesson 7 Configuring TestStand A. Station Options...7-2 B. Adapter Configuration...7-6 C. Edit Search Directories...7-11 D. Report Options...7-12 E. Database Options...7-17 Lesson 8 Executing Tests in Parallel A. Multi-UUT Testing...8-2 B. Multithreading...8-6 C. Executing Sequences in New Threads...8-10 D. Multithreaded Process Models...8-12 E. Multithreading Caveats...8-22 F. Synchronization Step Types...8-26 Lesson 9 Best Practices for Test Development A. Creating Modular Test Systems...9-2 B. Using Appropriate Data Scope...9-6 C. Using Setup and Cleanup Groups...9-9 D. Handling Non-Product-Specific Operations...9-10 E. Documenting Test Systems...9-11 F. Additional Resources...9-16 NI TestStand I: Introduction Course Manual iv ni.com/ja
Contents Contents Lesson 5 ナショナルインスツルメンツのトレーニングコース Managing Data Lesson A. 5 TestStand Data ナショナルインスツルメンツでは Layout...5-2 LabVIEW ユーザのためのトレーニングコー Managing B. Expressions Data...5-12 A. C. TestStand Custom Data Data Types...5-17 Layout...5-2 B. D. Expressions Variables...5-24...5-12 C. E. Custom Importing Data and Types...5-17 Exporting Properties...5-32 ナシ D. Variables ョナルイ...5-24 ンスツルメンツの認定プログラム Lesson E. 6 Importing and Exporting Properties...5-32 Overriding Callbacks NI 認定資格は NI 製品および技術に関する専門性を認定するものです 計測 Lesson A. 6 Callbacks...6-2 Overriding B. Process Callbacks Model Callbacks...6-4 A. C. Callbacks...6-2 Engine なお LabVIEW...6-7 認定試験の詳細については ni.com/jp/training を参照し B. Process Model てください Callbacks...6-4 Lesson C. 7 Engine Callbacks...6-7 Configuring LabVIEW TestStand リソース Lesson A. 7 Station Options...7-2 このセクションでは LabVIEW に関する上記以外の情報源をご紹介します Configuring B. Adapter TestStand Configuration...7-6 A. C. Station Edit Search Options Directories...7-2...7-11 LabVIEW B. D. Adapter Report 関連の出版物 Options...7-12 Configuration...7-6 C. E. Edit Database Search Options LabVIEW Directories...7-17...7-11 関連書籍 D. Report Options...7-12 LabVIEW プログラミングおよびアプリケーションに関する書籍は数多く出版さ Lesson E. 8 Database Options...7-17 れています ナショナルインスツルメンツのウェブサイトには LabVIEW に関 Executing Tests in Parallel Lesson A. 8 Multi-UUT Testing...8-2 Executing B. Multithreading Tests in Parallel...8-6 A. C. Multi-UUT Executing Sequences Testing...8-2 in New Threads...8-10 B. D. Multithreading Multithreaded Process...8-6 Models...8-12 C. E. Executing Multithreading Sequences Caveats...8-22 in New Threads...8-10 D. F. Multithreaded Synchronization Process Step Types Models...8-12...8-26 E. Multithreading Caveats...8-22 Lesson F. 9 Synchronization Step Types...8-26 Best Practices for Test Development Lesson A. 9 Creating Modular Test Systems...9-2 Best Practices B. Using for Appropriate Test Development Data Scope...9-6 A. C. Creating Using Setup Modular and Cleanup Test Systems...9-2 Groups...9-9 B. D. Using Handling Appropriate Non-Product-Specific Data Scope...9-6 Operations...9-10 C. E. Using Documenting Setup and Test Cleanup Systems Groups...9-9...9-11 D. F. Handling Additional Non-Product-Specific Resources...9-16 Operations...9-10 E. Documenting Test Systems...9-11 F. Additional Resources...9-16 スを多数実施しています 今回受講されたトレーニングの次のコースや 他の分 野を扱うコースもご用意しています コーステキストのご購入や 講師によるト レーニングのお申し込みについては ni.com/jp/training をご覧ください オートメーション業界において NI 認定資格は当該分野における経験やスキル 知識の証として 雇用主 クライアント 同僚により高く評価されるものです する書籍の一覧と これらの本を購入できるサイトへのリンクがあります 詳細 は http://zone.ni.com/devzone/cda/tut/p/id/5389 をご覧ください NI TestStand I: Introduction Course Manual iv ni.com/ja NI TestStand I: Introduction Course Manual iv ni.com/ja