Objective: To show how TestStand runs multiple sequence s in parallel
1) Specify the adapter 2) Select the step type
3) Specify the test module
4) Configure the step properties
Lesson 3 Creating Sequences Exercises
Exe
Exercircise 3se 3-1 -1 CreCreatiating Sng Stepteps is in tn the She Sequequence ence EditEditoror
Object
Objective: ive: TTo add new steo add new steps to a maips to a main sequencn sequence that wie that will set oll set off an alaff an alarm if the Rrm if the ROM TOM Test faiest fails.ls.
Earlier lessons defined the Sequence Editor as the GUI interface to TestStand for creating and modifying sequence files. Now that this functionality has been defined, it is important to learn how to add steps to a sequence file to create a testing sequence for a UUT. When a test fails, there should be a way to notify the operator of the failure. Seeing this information in the report may be insufficient, and some other notification method might be appropriate. In this exercise, the sequence file will set off an audible alarm whenever the ROM test fails for any UUT.
1. In the Sequence Editor, select File File»»OpenOpen and select
C:Exercises\TestStand I\Ex 3-1 Add Beep Step.seq. 2. Create two steps that set off an alarm if the ROM Test fails.
Before inserting a step that calls a code module, you must specify the module adapter that the step uses. Select the adapter in the Adapter Selector Ring to be the DLL Flexible Prototype Adapter DLL Flexible Prototype Adapter. The step uses the DLL Flexible Prototype Adapter to call a function in a DLL.
3. Right-click on ROM Test and select Insert Step Insert Step»»ActionAction.
An Action step type calls code modules that perform actions necessary for testing, such as initializing an instrument. By default, action steps do not pass or fail, so they are not used for actual product tests. You will use steps for testing later in this course. Name this step AlarmStart AlarmStart. You can always rename a step later by right-clicking on it and selecting rename
Lesson 3 Creating Sequences Exercises
4. Right-click on the AlarmStart step and choose Properties Properties, as shown below, or double-click on it to open the Step Properties dialog box.
Lesson 3 Creating Sequences Exercises
5. The Step Properties dialog box is shown below.
The Step Properties dialog box contains several options for configuring the step, including:
• When to load the step
• What conditions will cause the step to execute
• What information TestStand examines to determine whether a test passes or fails
• Whether TestStand executes the step in a loop • Ways to sychronize the step with other executions
Lesson 3 Creating Sequences Exercises
6. Click on the Specify Module Specify Module button. This brings up the Edit DLL Call dialog box. Click theBrowseBrowse button and select the fileDllfuncs.dll from the CVI Project Files directory, for the DLL Pathname DLL Pathname. Click OK OK to select this file.
A dialog box may appear with options for the file path. Choose the option to use a relative path for the file you selected use a relative path for the file you selected , so that the path to the code source is stored relative to the sequence file. Click OK OK to return to the Edit DLL Call dialog box.
If the module is not within a subdirectory of the configured search directories, you are prompted to resolve the path by adding the file you selected to the search directories, use an absolute path to the file, or use a relative path for the file.
Lesson 3 Creating Sequences Exercises
Select the Edit Prototype option and set the values as shown below. The tone parameter sets the beep frequency, which is 1000 Hz in this case.
Note
Note You must build a DLL with a type library for the function prototypes to appear in the Function Prototype tab at the bottom of the dialog box and for all parameters to appear in the Parameter menu ring. To create a type library in LabWindows/CVI, you must create a Function Panel file first.
Do not run the sequence until all the steps in this exercise have been completed. Click OK OK to close the Edit DLL Call Edit DLL Call dialog box. 7. Click the Preconditions Preconditions button to open the Preconditions Editor.
A precondition specifies the conditions that must be true for TestStand to execute a step during the normal flow of execution in a sequence. For example, you might want to run a step only if a previous step passes.
Lesson 3 Creating Sequences Exercises
In the Preconditions - MainSequence dialog box shown below, you enter the conditions that control when this particular test executes.
For this exercise, click the ROROMM TesTestt in the InsInsertert SteStepp StaStatustus section. Click the Insert Step Fail Insert Step Fail button. This inserts the condition that the AlarmStart step executes only if the ROM test fails. Notice that other options for conditions include running the current step only if another test passed, caused an error, or has executed. It is also possible to create expressions that can be evaluated and used as conditions for executing a step. Inserting more than one precondition and the use of TestStand expressions are discussed later in this course.
Lesson 3 Creating Sequences Exercises
8. After setting the step’s preconditions, configure and examine other step properties.
If the AlarmStart Action Properties dialog box is closed, open it by double-clicking on the Alarm Start step in the sequence window. Click the Run Options Run Options tab to examine the run options and ensure that Run Run Mode
Mode is Normal Normal, with the step results recorded in the report. Examine the other Load, Unload, Run, Precondition Evaluation, and Window Activation options. Ensure that the settings are as shown below before continuing.
Although some options are self-explanatory, it is helpful to understand the various Run Mode options and how to use them to configure TestStand step execution. The options are useful in debugging, to test the various states of each step, and for understanding how the preconditions relate to each other.
• Force Force PassPass —TestStand does not execute the step and does not evaluate its preconditions. Instead, TestStand sets the status of the
Lesson 3 Creating Sequences Exercises
• Skip Skip—TestStand does not execute the step and does not evaluate its preconditions. Instead, TestStand sets the status of the step to SKIPPED automatically.
• Normal Normal—TestStand executes the step normally. This is the default value.
9. Click the Post Actions Post Actions tab, as shown below.
The Post Actions tab specifies an action that occurs after a step executes. In the case of a step that is specified as an Action step such as theStartBeep step, the only post action option for the step is to use the Custom Condition option since an Action step does not“Pass” or “Fail”. For other types of test steps the post action can be conditional on the pass/fail status of the step or any custom condition expression. For example, you may want to jump to a particular step in the sequence if this step fails. By default, the On Pass and On Fail actions are “goto next step.” Review the other available options, ensuring that the final options are configured as shown above.
Lesson 3 Creating Sequences Exercises
10. Click the Loop Options Loop Options tab.
You can use the LoopLoop OptOptionionss tab to configure an individual step to run repeatedly in a loop when it executes. In this case, configure the step to loop 25 times and record the results of each iteration. Ensure that the settings are the same as shown above.
Notice that as changes are made in this window, TestStand automatically builds an expression in the Loop While Expression and Loop Status Expression controls. An expression is a formula that TestStand evaluates to obtain a new value from the values of multiple variables or properties. Expressions are discussed further in the next lesson.
The step runs 25 times, and the step returns aFAILED status if any iteration fails. This is determined by the loop result, which is Fail if less than 100 percent of the iterations pass.
Click OK OK to close the AlarmStart Properties dialog box. The sequence file should now be the active window.
Lesson 3 Creating Sequences Exercises
11. Create another action step by right-clicking on the AlarmStart step and selecting Insert Step Insert Step»»ActionAction. Name the step AlarmStop. Right-click on the AlarmStop step and select Specify Module Specify Module, repeating the steps given in Step 6 above, but selecting the function as shown below. This step stops the PC speaker from beeping.
12. Save Ex 3-1 Add Beep Step.seq. Execute the sequence by selecting ExecuteExecute»»TeTestst UUUUTsTs. You should hear the PC speaker beep if you make the ROM test fail. (Note that some PCs may not have a speaker. If the sound is not enabled on the machine, and this course is being taught at a National Instruments training facility, ask the instructor for assistance.)