Hands-On Introduction to TestStand

  • Upload
    saji8

  • View
    108

  • Download
    6

Embed Size (px)

DESCRIPTION

NI

Citation preview

  • Hands-On: Introduction to NI

    TestStand

    Please do not remove this manual.

    You will be sent an email which will enable you to

    download the presentations and an on-line version of this

    manual Thank you!

    Version 13.11 1 Hr

    uk.ni.com ireland.ni.com

  • Hardware Requirements:- None Required

    Software Requirements:- TestStand 2013

    LabVIEW 2013

  • Exercise 1: Add Tests Using NI TestStand Sequence

    Editor

    Objective: To create a TestStand sequence and to add steps to the TestStand

    MainSequence for a handheld device that is under test. The NI LabVIEW application that performs an audio quality test to determine the sound

    quality of a handheld device has already been created. In the exercises that follow, the

    focus will be on the TestStand Sequence Editor. The TestStand Sequence Editor is a

    graphical user interface (GUI) for creating and modifying sequence files. The sequence

    editor is used to add steps to a sequence file to create a test sequence for the handheld

    device.

    Setup: Create a Hands-on project in LabVIEW

    1. Open LabVIEW 20XX (Windows Start ButtonAll ProgramsNational

    InstrumentsLabVIEW 20XXLabVIEW) and wait until the Getting Started Window is

    displayed.

    2. Open the template for the Hands On:

    a. Click the Create Project button on the Getting Started Window.

  • b. Under the Hands On section to the left of the screen, select Test then TestStand

    Hands-On 1 Hr.

    c. Save the project on the Desktop or in any other folder of your choice as TestStand Hands-On.lvproj when prompted on the template creator. Make

    a note of where you have saved the project. Click on Finish to create the

    Hands-On project.

  • Exercise 1A: Simulated Acquisition Device

    1. Open Measurement and Automation Explorer using the desktop shortcut

    2. Right Click Devices and Interfaces Create New and then select Simulated NI-

    DAQmx Device or

    Modular Instrument Click Finish

  • 3. Type PCI-5152 in the Create Simulated NI-DAQmx Device Search box and double-click the result to create simulated device in MAX configuration tree.

    4. Expand Devices & Interface to see the new simulated device

  • Exercise 1B: Edit Audio Quality Test VI Properties

    1. Open Exercise 1B_Audio Quality Test.vi from your Hands-on project tree

    item..

    2. This VI acquires a signal from a software simulated PCI-5152 digitiser which is software

    simulated in Measurement and Automated Explorer. The LabVIEW block diagram code

    contains VIs for FFT, Amplitude and Frequency analysis and a subVI that filters the signals.

    3. You will need to edit the VI so that it will output the result of the Pass terminal to TestStand.

    a. Press to toggle between front panel and block diagram windows. With

    the front panel open, click on the top right box of the connector pane.

    b. Then left-click on the Pass/Fail Boolean indicator on your front panel. This associates

    the Pass Boolean control with the selected terminal of your VI.

    4. Switch to the block diagram with . The NI Scope Express VI on the block diagram

    acquires the simulated signal from the handheld devices audio output. Double click the NI-Scope Express VI to bring up the configuration options.

  • On the resulting configuration dialogue, configure the values as shown in the figure

    below. All of the other values are left on their default setting. Be sure that channel

    0 is highlighted in the Channels box when making these changes.

    Configuration Option Value Device

    Channel 0

    Channel 1

    Range (V)

    Offset (V)

    Sample rate (S/s)

    Record length

    Dev1 (PCI-5152) Checked Unchecked 10 5 10M 1k

    a. Select the Trigger tab.

    b. On the resulting configuration dialogue, configure Max time (s) to be 0.1. All of

    the other values should be left at their default setting.

    c. Click OK to close the dialogue and save changes.

    c.

  • 5. The final change that you need to make to the VI is to change the window

    appearance. a. Navigate to File VI Properties

    b. On the resulting dialogue window, select Window Appearance in the Category

    drop-down box.

    c. Select the Dialog radio button.

    d. Select OK to save changes.

    6. Run the VI to see how the window appears.

    7. Save and close the VI.

    8. Leave LabVIEW open and continue

  • Exercise 1C: Create a TestStand Sequence and Add the Frequency Test Step

    1. Select Start Programs National Instruments TestStand 20XX Sequence Editor

    2. After the TestStand Sequence Editor opens, a login dialogue will appear. There is no password.

    Click OK. Each time you open the Sequence Editor, you will be prompted to login.

    Tip: You can control access to specific TestStand capabilities based on the user login level.

    Using an interactive user manager environment, you add, remove, and edit users, their

    passwords, access levels, and profiles. In this case, when you log in as an administrator, you

    have access to all TestStand sequence editor capabilities.

    3. The TestStand Sequence Editor should appear as in the following figure. The areas of the

    sequence editor are labeled below.

  • Sequences Pane Steps Pane

    Insertion

    Palette

    Template

    Area

    Step

    Setting

    Pane

    4. Now you will confirm that the execution process model is correct for this exercise. In this

    case, you will use the Sequential execution process model.

    a. Select Configure Station Options and select the Model tab.

    b. Use the Station Model drop-down to select SequentialModel.seq or click the

    browse button, to go to \Program Files\National Instruments\TestStand 20XX\Components\Models\TestStandModels and select SequentialModel.seq.

    c. Click OK on the Station Options window to return to the Sequence Editor.

  • 5. To add a new step you will first have to select the LabVIEW adapter which allows you to call

    and run LabVIEW VI code modules from TestStand. To select the LabVIEW adapter, simply

    click the LabVIEW icon at the top of the Insertion Palette.

    6. Now you will insert the first step in the test sequence, which will test the sound quality of

    the handheld device. The test will return a Boolean value for the pass/fail result, so the type

    of test you want is a pass/fail test.

    a. Click the + sign in the Insertion Palette next to the Tests folder.

    b. Drag and drop a Pass/Fail Test from the Insertion Palette to the Main step

    group in the Steps pane as shown in the following image.

  • 7. Select the Pass/Fail Test step and press F2 to edit the test steps name. Rename the step Audio Quality Test

    8. Now that youve selected the type of step, you will need to specify which LabVIEW VI this step calls. You will use the LabVIEW VI that you saved earlier in this exercises as the code for

    this test.

    i. When you click on the Audio Quality Test step, the Step Properties pane automatically updates with the steps properties.

    ii. Click on the Module tab in the Step Setting pane. This will allow you to choose the code module, in this case a LabVIEW VI, which you want to associate with this

    step.

    iii. We want to select the VI we altered earlier so right-click the Exercise 1B_Audio Quality

    Test.vi inside the Exercises folder in the project. After right clicking the VI click Explore to locate this file on the computer. Copy this filepath. NOTE: Please use the file location specific to your machine as this may change depending on the install location.

    iv. Click the File Browse button on the right of the VI Path session in TestStand.

    v. Paste the file path into the File Name field and then select Exercise 1B_Audio Quality Test.vi and click Open.

    vi. If a File Not Found dialogue appears, select Use an absolute path for the file you selected and click OK.

    9. Now that you have selected the VI, you will need to define where to store the test result in

    TestStand.

    a. Notice that the Description and Connector Pane now shows the VI icon with a

    Boolean output terminal. This output is available to TestStand because of the

    edit you made to the connector pane of the VI earlier in Part A of this exercise.

    b. Click the Value field for Pass Boolean parameter and click the Expression

    Browse Dialog Box button to the right. You can use the Expression Browser Dialog Box to interactively build an expression by selecting from lists of variables, properties, operators, and functions.

    c. In this case, navigate the properties of the step and select Step Result

    PassFail. Click Insert to select that property.

  • d. Step.Result.PassFail is the TestStand property that will now contain the

    Pass value.

    e. Click OK again to return to the sequence editor window.

    10. In order to see how the test is executing you will have to show the front panel of the VI.

    a. Left click the Show VI Front Panel button, . This will then display the

    following icon to show that the front panel will be shown,

    NOTE: The Show VI Front Panel button is located to the right of VI path.

    11. You have finished adding the first step to your test sequence.

  • Exercise 1D: Run the Sequence

    1. Now that you have created your first test sequence, you can execute your test sequence. Select Execute Single Pass.

    2. Select Yes to save the sequence file to the Exercises folder and name the sequence file Ex 1

    Handheld Test.seq. The Exercise folder is located in the hands-on project which you saved in the

    pre-exercise.

    3. The test sequence will now execute. You should see the Audio Quality Test VI appear on the

    screen. If the VI passed, the test step will pass, if the VI failed the test step will fail.

    4. A report for your test sequence will automatically be generated.

    Figure 9 UUT

    Report

    5. To run another test, click Execute Restart.

    6. Close the Single Pass window by selecting Window Close Completed Executions

    when you are finished.

    End of Exercise 1

  • Exercise 2: Add Tests Using Preconfigured Step Templates

    Objective: To complete a TestStand sequence by adding steps to the MainSequence using built-in

    TestStand preconfigured step templates. You will build on the sequence file you created in the

    previous exercise.

    Preconfigured step templates allow you to easily create and store preconfigured templates of the

    steps you created in the Sequence Editor. These templates can be used to quickly build sequences

    based on commonly used steps.

    Exercise 2A: Create Your First Template

    1. If you closed the sequence you created in the last exercise, reopen it.

    a. Open Handheld Test.seq in your Exercises folder. The Exercise folder is located

    in the hands-on project which you saved in the pre-exercise.

    2. In the last exercise, you completed your first test sequence by adding your first step. Now

    we are going to use that step to create a step template.

    a. In the Templates Area, expand the Steps folder by clicking the + sign. This will reveal another folder, Multifunction Handheld Device Tests.

    b. If the Multifunction Handheld Device Tests folder does not appear, import it by

    right clicking and selecting import, then open the file named Multifunction Handheld Test Templates.ini located in the templates folder within the exercise

    folder.

    c. Expand the Multifunction Handheld Device Tests folder by clicking the + sign.

    This will reveal a list of the preconfigured step templates.

  • d. In the MainSequence, click and drag your step, Audio Quality Test, into the

    Multifunction Handheld Device Tests folder to create a new template.

    You have now created your first template. You can drag this template into your

    sequence file to reuse it at a later time.

    Exercise 2B: Create a TestStand Sequence and Add the Template Steps

    1. Create a new sequence file for the complete handheld test.

    a. Select File New Sequence File to create a new sequence file.

    b. Select File Save Sequence File and save the file as Ex 2 Complete Handheld Test.seq in your Exercises folder. The Exercise folder is located in the hands-on

    project which you saved in the pre-exercise.

    2. Add steps to the Setup step group.

    The Setup step group runs before the Main step group. This step group should be used

    for initialisation steps, such as turning instruments and other devices on. For our

    example, we will initialise and configure all of our test machines.

    a. Click the + sign next to Setup step group in the Steps pane to expand the

    Setup step group.

  • b. Drag the Initialize Equipment template from the Insertion Palette into the

    Setup step group. This will create a step using the template that has been

    created for you.

    3. Add steps to the Main step group.

    The Main step group is where the bulk of the work should be performed by your test

    sequence. For our example, we will perform all of our tests in the Main step group.

    a. Click the + sign next to the Main step group in the Steps pane to expand the

    Main step group.

    b. Drag the Power Consumption Test step template into the Main step group.

    The power consumption test will verify whether the phone stays within an

    acceptable range for power consumption. If this test fails, we do not want to

    run any of the other tests.

    c. Under the Insertion Palette, click the + sign next to Flow Control to

    expand the flow control steps. Flow control steps allow developers to control

    the order of execution of steps in a TestStand Sequence with constructs such

    as While Loops and If statements.

    d. Drag an If step type under the Power Consumption Test. Click the If step.

    The Step Settings window will update to show the If step properties. Click

    the Condition Builder button on the right to build a condition for the

    step.

    e. Select Power Consumption Test under the Insert Step Status dialogue. Click

    the Insert Step Pass button to insert a condition in the statement. This will build

  • the condition in the If step that is true if the Power Consumption Test passes. If the

    test fails, nothing inside of the If statements will run.

    f. Click OK to exit the Condition Builder.

    g. Drag the LED Test template into the Main step group, inside of the If block. This

    test will test the LED of the handheld device.

    h. Drag the Volume Test and place it underneath the LED Test. This will test that

    the volume of a signal from the phone is within an acceptable range.

    i. Drag an If step type under the Volume Test. This will create a nested If block.

    Follow step d to create a Pass condition that checks the Volume Test instead

    of the Power Consumption Test.

    j. Drag the Audio Quality Test template inside the new If block. Because the test

    is within the new If block, TestStand will only run the Audio Quality Test if the

    Volume Test passes. The Audio Quality Test step is the step you created

    previously.

    k. Drag the Bluetooth Test template underneath the new End step.

    l. Drag the Wi-Fi Test template underneath the Bluetooth Test step.

    m. Drag a For step type from the Flow Control menu underneath the Wi-Fi Test.

    A For step type will allow you iterate over a group of steps a specified number of

    times. The step settings dialogue will automatically change to the For Loop

    parameters.

    n. Enter the number 4 in the Number of Loops text box. This will tell the loop

    how many times it should iterate.

  • o. Click the Expression Browser Dialog Box button next to the Loop Variable dialogue box. This will show the Expression Browser Dialog Box

    which allows you to build an expression. Right-click on word Locals in the

    tree shown and select Insert Number. This will create a local number variable.

    Name the variable ImpactTestCount.

    p. Click the Insert button to build your expression. Locals.ImpactTestCount will

    now appear in the Expression window.

    q. Click OK to insert Locals.ImpactTestCount as the expression. This variable will

    keep track of how many times the loop has iterated.

    r. Drag the Impact Test template inside of the For Loop.

    4. Add steps to the Cleanup step group.

    The Cleanup step group runs after the Main step group. As its name implies, it should be

    used to provide cleanup for the tests that have been performed in this sequence. For this test,

    we will turn off all of our test instruments in this step group.

    a. Click the + sign next to Cleanup to expand the Cleanup step group.

    b. Drag the Shutdown Instrumentation template into the

    Cleanup group. Your sequence should resemble the following.

  • Exercise 2C: Run the Completed Sequence

    1. Now that you have completed the entire test sequence, you can execute the completed test. Select Execute Single Pass. If prompted, select Yes to save the sequence file.

    2. View the test results.

    3. To run another test, click Execute Restart.

    4. Close the Single Pass window by pressing the Close button on the window or selecting

    Window Close Completed Executions when you are finished.

    End of Exercise 2

  • Exercise 3: Debug Test Sequence Using the NI

    TestStand

    Sequence Editor

    Objective: To become familiar with using breakpoints and debugging tools in the sequence editor.

    When you create a sequence file, you might want to observe sequence execution to make

    sure the sequence behaves as you need. During debugging, you might want to observe

    execution in some sections of a sequence but not others. In this exercise, you want TestStand

    to execute the sequence until it reaches a section you want to analyse. TestStand allows you to insert convenient stopping points, known as breakpoints, in the sequence. Like most modern development systems, TestStand

    allows you to set and remove multiple breakpoints for every sequence file.

    Exercise 3A: The Step Debugging Tools

    1. We want to debug an advanced version of the test we just made. In the Solutions folder in the project

    explorer right-click the Solution 2 Complete Handheld Test.seq. After right clicking, click Explore to locate this file on the computer. Copy this filepath. NOTE: Please use the file location specific to your machine as this may change depending on the install location.

    2. In the sequence editor in TestStand, select File Open File and paste the file path you copied in.

    Select Solution 2 Complete Handheld Test.seq. Open the file.

    3. Left-click the space to the left of the LED Test to set a breakpoint on that test. A red stop icon appears, as shown below, to indicate the breakpoint.

    Figure 1 Breakpoint Set

    4. Click the Run button on the sequence editor toolbar. This executes the sequence using the Test UUTs Execution entry point.

  • 5. Enter any number into the UUT Information dialogue box and click OK. 6. Notice that the execution pauses at the first breakpoint, in this case, the LED Test, because

    you inserted a breakpoint at this step. The step into, step over, and step out debugging tools

    should be enabled on the toolbar.

    7. Click the Step Over button to move to the next step.

    8. Click the Resume button to continue execution.

    9. Before the execution completes, click the Terminate button to terminate the execution and display the results of all steps executed in the report. If your execution reaches the UUT Result

    dialogue before you have a chance to terminate, start a new UUT and then terminate the

    execution. 10. Click Terminate in the Testing Terminated for Current UUT dialogue box that launches.

    11. Close the report and return to the Sequence File window.

    Exercise 3B: Stepping into a Code Module

    1. Click Run to run the sequence again. Enter any number in the UUT Information

    dialogue box.

    2. When the execution pauses at the LED Test step, this time press the Step Into button

    .

    3. Notice how the LabVIEW VI Exercise_LED Test.vi has now opened. Change to the

    block diagram by selecting Window Show Block Diagram.

    4. Right-click on the wire between the Divide VI and the Add VI. Select Set

    Breakpoint to set a breakpoint.

    Figure 2 Set a Breakpoint in

    LabVIEW

    5. Click the white Run button in LabVIEW to execute the code module. Notice that

    the LabVIEW code breaks at the breakpoint you set.

    6. Move the mouse cursor over the wire to see the pointer change to a Probe icon. Clicking

    on the wire will allow you to see the value at this point during run-time.

    7. Click the red button labeled Continue , to continue execution of the code module.

    8. Once the LabVIEW code module has finished executing, right-click on the breakpoint

    you set and select Clear Breakpoint.

  • Figure 3 Clearing a

    Breakpoint

    9. To return execution to TestStand, press the black Return to caller button .

    10. When the focus returns to TestStand, press the Resume button to finish the

    TestStand execution.

    11. Close the report and the sequence file. Do not save.

    End of Exercise 3