• No results found

Part A: Adding Steps to the SequencePart A: Adding Steps to the Sequence

In document Test Stand (Page 185-198)

Part A: Adding Steps to the Sequence

1. Navigate to C:\Exercises\TestStand I and open Ex 4-4 Passing Parameters.seq .

2. Before continuing with the exercise, click the Parameters Parameters tab. Use the View Ring

View Ring to select the AMDProcessor AMDProcessor and INTELProcessor INTELProcessor sequences. Notice that the AMDProcessor sequence has two parameters, and the INTELProcessor sequence has three parameters. This exercise describes how to share data with these subsequences using parameters and how TestStand uses default values if no data is specified for a given parameter.

3. Right-click on the Powerup Test step and select Insert Step Insert Step»»MessageMessage Popup

Popup from the context menu.

4. Rename the new step Select CPU Type.

5. Right-click on the new step and select Edit Message Settings Edit Message Settings from the context menu.

6. Change the following control values on the Configure Message Box Step dialog box:

Title Expression "Select CPU"

Message Expression "Please select the CPU Type for the UUT."

Button 1 "INTEL CPU" Button 2 "AMD CPU" Cancel Button None

Lesson 4 TestStand Parameters, Variables, and Expressions Exercises

The Configure Message Box Setup dialog box should resemble the following screen.

7. Click OK OK to close the Configure Message Box Step dialog box. 8. Right-click on the Select CPU Type step and selectPropertiesProperties from

the context menu. 9. Click the Expressions tab.

Lesson 4 TestStand Parameters, Variables, and Expressions Exercises

10. Click on the Browse button in the Post Expression. In the

Variables/Properties tab, right-click on Locals and select Insert String Insert String as shown. Name the new variableCPUType.

11. Enter the remainder of the expression in the Post Expression control by either using the Expression Browser or typing in directly:

Locals.CPUType = ((Step.Result.ButtonHit == 2)? "AMD": "INTEL")

Lesson 4 TestStand Parameters, Variables, and Expressions Exercises

This expression assigns the string value"AMD" or "INTEL" to the local variable, depending on which button the user clicks.

12. Click OK OK to close the properties dialog box.

13. Right-click onSelect CPU Type step and select the Insert Insert Step

Step»»Message PopupMessage Popup command from the context menu. 14. Rename the new stepSpecify Number of CPUs.

15. Right-click on the new step and select the Edit Message Settings Edit Message Settings command from the context menu.

16. Change the following control values on the Configure Message Box Step dialog box as shown below:

Title Expression "Number of CPUs"

Message Expression "Please select the number of CPUs installed for the UUT."

Lesson 4 TestStand Parameters, Variables, and Expressions Exercises

Button 4 "4" Cancel Button None

17. Click OK OK to close the Configure Message Box Step dialog box. 18. Right-click on theSpecify Number of CPUs step and select the

Insert Step

Insert Step»»Sequence CallSequence Call command in the context menu. 19. Rename the stepCPU Test.

Lesson 4 TestStand Parameters, Variables, and Expressions Exercises

20. Right-click on the new CPU Test step and selectSpecSpecifyify ModModuleule from the context menu.

21. Enable the Specify Expressions for Pathname and Sequence Specify Expressions for Pathname and Sequence option. This option allows an expression to determine the name of the sequence file to be called. By default, TestStand expects the name and path of the sequence file to be typed in, but by enabling this option, TestStand evaluates an expression to determine the path and filename for the sequence to be called at this step.

Also, enable the Use Current File Use Current File option. This option specifies the current sequence file as the location for the subsequence call to look. Because both subsequences that can be called are in the same sequence file as “MainSequence,” you should select this option. The only thing that needs to be selected is the name of the Sequence to be called within the sequence file.

22. Enter the following value for the Sequence Expression control: Sequence Expression Locals.CPUType + "Processor"

Lesson 4 TestStand Parameters, Variables, and Expressions Exercises

the number of parameters and their names. Exercise 3-3 demonstrated how to create the parameter manually to pass into the subsequence call, and this exercise uses the prototype to save time and prevent typing mistakes.

24. Click the Browse Browse button in the Load Sequence Prototype dialog box. 25. Navigate toC:\Exercises\TestStand I and open Ex 4-4

Passing Parameters.

26. Click OK OK to close the Select Sequence File dialog box.

27. Select the AMDProcessor sequence from the Load Sequence Prototype dialog box for the Sequence Ring Sequence Ring. Click OK OK to close this dialog box. Notice that TestStand populates the Parameters section with the parameter list for the sequence. This sequence requires two parameters named CPUsInstalled and CPUFail. Now the location of the values to be passed as parameters must be constructed.

28. Click on the CPUsInstalled parameter. 29. Select the Enter Expression Enter Expression option.

30. Enter the following expression into its string control or click Browse Browse and use the expression browser to create the expression:

RunState.Sequence.Main["Specify Number of CPUs"] .Result.ButtonHit

Lesson 4 TestStand Parameters, Variables, and Expressions Exercises

31. Click on the CPUFail parameter. 32. Select the Enter Expression Enter Expression option.

33. Enter the following expression into its string control or click Browse Browse and use the expression browser to create the expression:

Lesson 4 TestStand Parameters, Variables, and Expressions Exercises

34. Click OK OK to close the dialog box. The value to be passed to the subsequence has been assigned. The sequence can now decide which subsequence to call and what values to pass to the subsequence as parameters. Notice that because the value is passed using a parameter, there is no need to create a file global or station global variable. 35. The finished sequence file should resemble the following screen.

Select File File»»SaveSave to save the Ex 4-4 Passing Parameters.seq sequence file.

Lesson 4 TestStand Parameters, Variables, and Expressions Exercises

End of Part A

End of Part A

Part B: Running a Sequence

Part B: Running a Sequence

Complete the following steps to run the sequence created in Part A. 1. Place a breakpoint on the CPU Test step by clicking to the left of the step

icon or by right-clicking on the step and selecting Toggle Breakpoint Toggle Breakpoint from the context menu.

2. Select Execute Execute»»Single PassSingle Pass.

3. Click Done Done in the Test Simulator prompt.

4. Click the INTEL CPU INTEL CPU button in the Select CPU prompt. 5. Click the 2 2 button in the Number of CPUs prompt.

6. After the execution pauses at the breakpoint on the CPU Test step, single-step into the subsequence by selectingDebugDebug»»StStepep InIntoto. Notice that the Call Stack pane listsINTELProcessor sequence at the bottom of the sequence call stack, as shown below. The Call Stack shows the sequences that have been called, with the most recently executed sequence at the bottom.

Lesson 4 TestStand Parameters, Variables, and Expressions Exercises

7. Click on the ContextContext tab and notice the values of the two parameters for the sequence, as shown below.

The value of the CPUsInstalled parameter is equal to the value on the button you clicked in the Specify Number of CPUs prompt. Notice that MainSequence in the INTELProcessor.seq sequence file also requires a ModelName parameter. The sequence call step that was created did not specify this parameter, so the engine initializes the parameter value to its default value.

Lesson 4 TestStand Parameters, Variables, and Expressions Exercises

11. Click Done Done in the Test Simulator prompt.

12. Click the AMD CPU AMD CPU button in the Select CPU prompt. 13. Click the 3 3 button in the Number of CPUs prompt.

14. When the execution pauses at the breakpoint on the CPU Test step, step into the subsequence by selecting Debug Debug»»Step IntoStep Into.

Notice that the Call Stack pane lists AMDProcessor sequence at the bottom of the call stack.

15. Complete the execution by selecting Debug Debug»»ResumeResume, and review the report.

16. Run the example a few more times and select other options. Each time, notice that the parameter values are passed to the dynamically called sequence file. Close the execution window and the sequence file window when finished.

End of Part B

End of Part B

End of Exercise 4-4

End of Exercise 4-4

Lesson 4 TestStand Parameters, Variables, and Expressions Exercises

Exe

Exercircise 4-se 4-5 5 DynDynamiamicalcally Sly Seleelecticting Wng Whichich Seqh Sequencuence to Re to Runun

Object

Objective: ive: TTo creato create a tese a test that that dynamt dynamicallically seley selects whicts which sequch sequence to ence to run.run.

You will learn how to dynamically select a sequence file to run. Open the sequence file C:\Exercises\TestStand I\Ex 4-5 Dynamically Selecting Which Sequence to Run.seq. The MainSequence contains three steps:Generic Processor, Intel Processor, and AMD Processor. In this exercise your goals are to:

1. Add a step that asks the user to select the type of processor to test. 2. Make the necessary changes to ensure that the selected processor is

tested.

Hints:

Hints:

Use aMessage Popup step to ask the user which type of processor to test. The Message Popup step stores the selected button in:

RunState.Sequence.Main[Name of the Message Popup step].Result.ButtonHit.

As shown below, use the Preconditions Preconditions expression of each step to determine which step will execute.

Lesson 4 TestStand Parameters, Variables, and Expressions Exercises

Save and close the sequence.

In document Test Stand (Page 185-198)

Related documents