Objective: Start building your test application by adding front panel controls and indicators of a new
LabVIEW VI. This exercise is the first step towards building an application that will test a filter. The
completed application (Exercise 3) will use an arbitrary waveform generator and digitizer (oscilloscope)
to perform a frequency sweep test. The following figure shows the results of this exercise.
1. Launch LabVIEW by selecting Start All Programs National Instruments LabVIEW 2011.
2. Select File New VI from the menu on the welcome screen.
3. To begin designing the front panel, you will create five numeric controls. These controls will contain
the parameters of the frequency sweep, including the number of steps in the sweep, the start and stop
frequencies, and the start and stop limits.
a. Right-click on the front panel and select Numeric Numeric Control and place the numeric
control on the front panel.
Tip: The Controls Palette provides access to many useful front panel controls such as input
boxes, command buttons, and gauges.
b. Name the numeric control Number of Steps.
c. Enter a value of 15.
1-1
Hands-On Seminar
d. Repeat the previous steps (a c) for four more numeric controls. Use the names and values in
the following chart.
Tip: Alternatively, you can make copies of the control (or any other object) if you click on the
control, press and hold the <Ctrl> key, and then drag the control to a new location.
Control
Value
Start Frequency
1000
Stop Frequency
100,000
Start Limit
1.05
Stop Limit
1.05
f.
Save the values of the controls by selecting Edit Make Current Values Default.
Hands-On Seminar
1-2
ni.com
4. Next you will create a Boolean indicator that displays the Pass/Fail result of the test.
a. Right-click on the front panel and select Boolean Square LED to create a Boolean.
g. Click OK to exit.
1-3
Hands-On Seminar
5. Place a graph display on the front panel to display the frequency sweep.
a. Right-click on the front panel and select Graph Waveform Graph.
Important: Make sure to select the Waveform Graph and not the Waveform Chart. They are
sometimes confused because the icons look similar, but the waveform Graph has a green grid
on the display.
b. Change the label of the graph to read Filter Response.
c. Right-click on the Waveform Graph and select Properties.
d. From the resulting dialog, select the Scales tab.
e. Choose Time (X-Axis) from the first drop down menu in the Scales tab. Uncheck Autoscale
and set the Minimum and Maximum input fields to be 0 and 0.001, respectively. The
resulting Properties dialog should look like the screenshot below.
f.
Now, choose Amplitude (Y-Axis) in the first drop down menu on this tab.
g. Uncheck Autoscale.
h. Set the Minimum and Maximum input fields to be -1.1 and 1.1, respectively.
i.
j.
Choose Time (X-Axis) in the first drop down menu and make sure that SI Notation is
selected.
Hands-On Seminar
1-4
ni.com
6. Arrange the controls and indicators so that the front panel looks similar to the image below.
1-5
Hands-On Seminar
7. Although you will not use the block diagram yet, switch to the block diagram to see the terminals of
the controls and indicators that you have added to the VI.
a. To switch to the block diagram, select Window Show Block Diagram.
b. Re-arrange the terminals so that they are similar to the figure below. The terminals on the left
side are your controls, while the terminals on the right side are your indicators.
Tip: Controls are front panel objects for entering data to a VI interactively or to a subVI
programmatically, such as a knob, push button, or dial. Indicators are front panel objects that
display outputs, such as a graph or LED.
c. If any terminal is missing a label, such as the Boolean indicator, right-click on it and select
Visible Items Label.
8. Select File Save and save your VI as Ex-1 FilterTest.vi in the Exercises folder.
End of Exercise 1
Hands-On Seminar
1-6
ni.com
9. If you have not closed your VI from the previous exercise, click File New from either the Front
Panel or Block Diagram to launch a wizard to create new VIs, projects and more. If you have closed
your earlier VI, you should have been returned to the LabVIEW splash screen. Click New to launch
the same wizard.
1-7
Hands-On Seminar
10. Select VI From Template Tutorial (Getting Started) Generate and Display and click OK.
Hands-On Seminar
1-8
ni.com
11. Examine the Front Panel and Block Diagram of this template VI. The Front Panel contains a
Waveform Chart and a STOP button as shown in the following figure.
The Block Diagram contains a Simulate Signal VI, which is currently configured to simulate a sine
wave and plot it to the chart.
1-9
Hands-On Seminar
12. Switch back to the Front Panel by pressing <Ctrl-E>. Since the Run button (the white arrow in the top
left corner) is solid, you can run this VI as it is. Click the Run button and examine the operation of the
VI. When you are finished, click the STOP button on the Front Panel to stop running the VI.
Note: As you will see later in the exercise, when the Run button in the upper left corner of both the
Front Panel and the Block Diagram changes from a solid white arrow, to a broken gray arrow, this
new icon indicates that the VI is currently not executable.
13. Now we can add some functionality to this basic VI. We will modify the VI to flash an alarm whenever
the signal value is above a certain level. Open the Controls palette (if it is not open already) by rightclicking the Front Panel window. A small pushpin icon in the upper left corner of this palette appears.
Click this pushpin to force the palette to remain on your screen.
14. Click the Numeric Controls palette, and select a Vertical Pointer Slide to be placed on the Front
Panel. To do this, click the Vertical Pointer Slide and drag it to the Front Panel. Click once to
place it.
Hands-On Seminar
1-10
ni.com
15. Click the Express menu item on the Controls palette to return to the Express Controls Palette. Click
the LEDs subpalette, and place a Round LED on the Front Panel.
16. Right-click the Vertical Pointer Slide and select Properties. A property page will appear. Examine
the different properties that you can modify. Make the following changes on the Appearance tab and
click OK to apply the changes.
Label: Limit
Slider 1: Check Show digital display(s)
1-11
Hands-On Seminar
17. Right-click the Round LED labeled Boolean, and select Properties. Examine the different properties
that can be modified. On the Appearance tab, change the label from Boolean to Alarm. Click OK to
apply your change. Move the objects on the Front Panel so it resembles the following.
18. Switch to the Block Diagram by pressing <Ctrl-E>. Double-click the Simulate Signal Express VI to
bring up its properties window. Examine the different properties you can modify. Change the
Amplitude of the signal to 10. Click OK to apply this change and to close the properties window.
Hands-On Seminar
1-12
ni.com
19. Bring up the functions palette by right-clicking the Block Diagram. Select Arithmetic & Comparison
Comparison and place the Comparison Express VI on the diagram.
Note
Finding functions can be challenging in any language. The Search function helps you quickly find and
place LabVIEW front panel and block diagram objects using predictive text. With the Functions Palette
open, click Search to open the search window.
1-13
Hands-On Seminar
Type comparison into the Search window. Note that the list of functions shown in the window is instantly
filtered based on the text that you type. Highlight the correct function and left-click on the block diagram to
place it.
When you place the Comparison Express VI on the Block Diagram, a dialog box appears that lets you
configure what type of comparison you will be doing. Make the following selections, then click OK to
apply these changes and to close the dialog box.
Compare Condition: Greater
Comparison Inputs: Compare to second input
Hands-On Seminar
1-14
ni.com
20. You can connect Controls, Functions, and Indicators on the Block Diagram by pointing to an object
and clicking it when the cursor changes to a spool of wire. You can then move the cursor to the object
you want to connect it to and click again. Connect the Limit control to the Alarm indicator.
Note: The Run button in the upper left corner of both the Front Panel and the Block Diagram has
changed from a solid white arrow, to a broken gray arrow. This new icon indicates that the VI is
currently not executable. If you click the Run button when it is solid and white, it runs the VI. Clicking
it when it is broken and gray brings up a dialog box that will help you debug the VI.
21. Click the Run button now. The resulting dialog box shows that, in this case, the error results from
connecting terminals of two different types. Since the Limit control is a Numeric type and the Alarm
indicator is a Boolean type, we cannot wire these two terminals together. Highlight the error by
clicking it, and then click Show Error. LabVIEW will highlight the location of the error.
22. Notice that the wire between Limit and Alarm is dashed and a red is displayed on it.
To delete this broken wire, press <Ctrl-B>. This keyboard shortcut removes all broken wires from the
Block Diagram.
23. Make your Block Diagram resemble the following image by completing the following steps.
Wire the Limit control to the Operand 2 input of the Comparison function.
Connect the wire between the Simulate Signals block and the Waveform Graph to the
Operand 1 input of the Comparison block.
Wire the Result output of the Comparison block to the Alarm indicator.
1-15
Hands-On Seminar
This will allow you to see the flow of data through your program.
28. When you are finished, stop the VI by clicking the Stop button on the Front Panel.
End of Exercise 1
Hands-On Seminar
1-16
ni.com
1-17
Hands-On Seminar
Hands-On Seminar
Configuration Option
Value
2,800,000
1-18
ni.com
Notice that the blue output terminal for the Sine signal moves to the top right of the VI.
4. Next, you will need to add a VI to generate a waveform using an arbitrary waveform generator.
a. Right-click on the block diagram, and select Measurement I/O NI ELVISmx NI
ELVISmx Arbitrary Waveform Generator Express VI.
1-19
Hands-On Seminar
b. Place the NI ELVISmx Arbitrary Waveform Generator Express VI to the right of the
Simulate Signal Express VI.
c. On the resulting configuration dialog, select corresponding ELVIS device and keep all other
values on their default setting.
d. Click OK.
Hands-On Seminar
1-20
ni.com
5. Next, you will need to initialize the arbitrary waveform generator with the output of the Simulate
Signal Express VI, and pass along any errors.
a. Wire the Sine output terminal of the Simulate Signal Express VI to the Channel 0 Signal In
input terminal of the NI ELVISmx Arbitrary Waveform Generator Express VI.
b. Wire the error out output terminal of the Simulate Signal Express VI to the error in input
terminal of the NI ELVISmx Arbitrary Waveform Generator Express VI.
Tip: The Simulate Signal and NI ELVISmx Arbitrary Waveform Generator Express VIs on the
block diagram are called nodes. A node is a program execution element, analogous to statements,
operators, functions, and subroutines in text-based programming languages.
Tip: The NI ELVISmx Arbitrary Waveform Generator Express VI will execute after the Simulate
Signal Express VI because of data dependency. This means a node cannot execute until it
receives data from another node. Therefore, the arbitrary waveform generator will not start
generation until the simulated waveform has been created.
1-21
Hands-On Seminar
c. On the resulting configuration dialog, select the corresponding ELVIS device and configure the
values as shown in the figure below. All of the other values are left on their default setting.
Hands-On Seminar
Configuration Option
Value
Channel 0 Enable
On
Channel 1 Enable
Off
1.25M
Record length
1.25k
Range (V)
1-22
ni.com
1-23
Hands-On Seminar
Value
Type
Edge
Source
Channel 0 Source
Slope
Positive
Level (v)
Important: The trigger source must be set to Channel 0, or the trigger condition will never be
met and no signal will be acquired.
f.
2. Now you will need to connect the error output from the NI ELVISmx Arbitrary Waveform Generator
Express VI to NI ELVISmx Oscilloscope Express VI. Wire the error out output terminal of the NI
ELVISmx Arbitrary Waveform Generator Express VI to the error in input terminal of the NI
ELVISmx Oscilloscope Express VI.
Hands-On Seminar
1-24
ni.com
3. Next, you will pass the acquired waveform to the front panel display. Wire the Channel 0 out output
terminal of the NI ELVISmx Oscilloscope Express VI to the Waveform Graph control called Filter
Response.
4. Finally, wire the output of Start Frequency control to the Frequency input of the Simulate Signal
Express VI so that you can interactively change the output frequency while the program executes.
5. The block diagram should resemble the image below. Check to make sure that your VI is free from
errors by checking that the Run arrow is not broken.
1-25
Hands-On Seminar
7. Click the Run button to verify that the VI is working properly. A sine wave should be displayed.
Tip: You may have noticed that the start of the waveform is a falling edge rather than a rising edge. This
is because the reference position for the NI-Scope Express VI trigger is set to 50% (Figure 8). In this case,
the rising edge trigger occurs at 500uS.
Figure 10 Run VI
Hands-On Seminar
1-26
ni.com
1-27
Hands-On Seminar
b. Click and drag to place the For Loop around the Express VIs and the two indicators as
pictured below.
Tip: The objects inside the loop will execute every time the loop repeats. The count terminal
is used to determine how many times the For Loop iterates.
Tip: LabVIEW creates a tunnel where the wire crosses the loop boundary. A tunnel allows data
to flow in and out of loops and structures.
Hands-On Seminar
1-28
ni.com
2. The Number of Steps control will determine the number of iterations of the For Loop.
a. Wire the Number of Steps control to the count terminal at the top left of the For Loop.
b. Right-click on the Number of Steps control and select Representation
I32. This will change the data type of the control to an integer.
Tip: By default, a Numeric Control is a double-precision floating-point
number (64 bits in size and can represent up to a 15 digit decimal number).
This format works well in most cases, but in this case an integer type can be
used since the loop count must be a whole number.
Tip: Notice that the color of the Number of Steps control changed from
orange to blue. LabVIEW uses colors and wires thickness to differentiate between different data
types. If you select Help Show Context Help, and move your cursor over a wire, you will see
the description of the data that the wire contains. You can view help for nodes on your block
diagram as well.
Now that the loop is in place and will execute the number of times determined by the Number of Steps
control, you need to add code so to that each time the loop iterates, a higher frequency will be generated.
For the first iteration of the loop, the output frequency will be equal to the Start Frequency. However,
subsequent loop iterations will increase the frequency by a set amount, which well call the Frequency
Step. To determine the value of the Frequency Step, use the following equation:
Stop Frequency Start Frequency
Frequency Step =
Number of Steps 1
1-29
Hands-On Seminar
3. You will use the Start Frequency, Stop Frequency, Number of Steps, and add some Numeric
functions to calculate the value of the Frequency Step.
a. In this step, you will calculate the numerator of the equation, Stop Frequency Start
Frequency.
i. Right-click on the block diagram and select Numeric Subtract. Place the Subtract
function to the right of the Stop Frequency control (outside of the For Loop).
ii. Wire the Stop Frequency control to the first (top) input terminal of the Subtract
function.
iii. Wire the Start Frequency control to the second (bottom) input terminal of the
Subtract function.
c. Finally, you will calculate the result of the numerator divided by the denominator.
i. Right-click on the block diagram and select Numeric Divide. Place the Divide
function to the right of the Subtract function (outside of the For Loop).
ii. Wire the output of the Subtract function to the first (top) input terminal of the
Divide function.
iii. Wire the output of the Decrement function to the second (bottom) input terminal of
the Divide function
Hands-On Seminar
1-30
ni.com
1-31
Hands-On Seminar
c. Right-click on the Loop tunnel created by the wire from the Start Frequency control and
select Replace with Shift Register.
Tip: A shift register is used to transfer values from one loop iteration to the next. In this case, the
first time the loop runs, it will use the frequency value of the Start Frequency control. But the
next loop will use the value transferred from the previous loop.
d. Wire the Start Frequency shift register to the bottom input of the Add function. This is
easier to do if you start the wire at the Add function.
e. Wire the output of the Add function to the shift register on the right side of the For Loop.
Using the default values that you entered in Exercise 1, the VI will generate 15 (Number of Steps)
different frequencies, starting at the Start Frequency (1000Hz), ending at the Stop Frequency
(100,000Hz).
Hands-On Seminar
1-32
ni.com
5. Switch to the front panel. Check to make sure that your VI is free from errors by checking that the
Run arrow is not broken. If the Run arrow is broken
of errors.
button.
8. Click on the Run button and see how the data flows from terminal to terminal and between loop
iterations.
9. Click on Highlight Execution button again to turn it off.
10. Return to the front panel and run the VI a couple times with different values for the Start and Stop
Frequencies. Remember, if the frequencies are too low or high, an error will result.
11. Select Edit Reinitialize Values to Default when you are done experimenting.
12. Save the VI.
End of Exercise 2
1-33
Hands-On Seminar
Hardware: For the beginning of this exercise, start with the connections used in the previous exercise,
Oscilloscope CH 0 (positive probe) to AO 0 (Arbitrary waveform generator), as pictured below:
1-34
ni.com
1. Use the following steps to make a working copy of the VI that you created in the previous exercise.
a. If you closed your VI earlier, open Ex-2 FilterTest.vi in your Exercises folder.
b. Select File Save As, select Substitute copy for original, and click Continue.
c. Name the VI as Ex-3 FilterTest.vi and click OK.
2. You will first need to remove one wire used in the previous exercise.
a. Delete the wire between the NI-SCOPE Express VI and the Filter Response waveform
graph by selecting the wire and clicking the <Delete> key.
b. Make sure that there is space for another Express VI between the NI-Scope Express VI and
the Filter Response Waveform Graph. If you need to widen the For Loop, resize it.
Figure 10 Delete NI-SCOPE Express signal wire and make room for another Express VI
1-35
Hands-On Seminar
3. You will add an Express VI that will compare a waveform with upper and lower limits that you set
and return the results.
a. Right-click on the block diagram and select Express Signal Analysis Mask & Limit.
b. Place the Mask and Limit Testing Express VI to the right of the NI-SCOPE Express VI.
c. On the resulting configuration dialog, check the Upper Limit and Upper Constant
checkbox.
d. Uncheck the Upper Inclusive checkbox.
e. Next, check the Lower Limit and Lower Constant checkbox.
f.
Hands-On Seminar
1-36
ni.com
c. Wire the Start Limit control to the Upper Limit of the Mask and Limit Testing VI. This is
the value that determines the upper limit.
Figure 13 Wire Start Limit to Upper Constant terminal of Mask and LImit Testing Express VI
For this test, the lower constant is the negative value of the upper constant. This will create a
peak-to-peak limit for the response waveform. To negate the value of the Start Amplitude value,
you will use a Negate function.
d. Right-click on the block diagram, and select Numeric Negate.
e. Place the Negate function towards the middle of the For Loop.
f.
Wire the Start Limit loop tunnel to the input of the Negate function. This is easier to do if
you start the wire at the Negate function.
g. Wire the output of the Negate function to the Lower limit of the Mask and Limit Testing VI.
1-37
Hands-On Seminar
5. Now you will wire the outputs for the Mask and Limit Testing VI.
a. Wire the Tested Signals output terminal of the Mask and Limit Testing Express VI to the
Filter Response waveform graph. Now the waveform that is read in by the digitizer will be
displayed on the front panel.
b. Wire the Passed output terminal of the Mask and Limit Testing Express VI to the Pass
Boolean indicator.
6. Switch to the front panel and run the VI. Notice the blue and green limits that are now on the Filter
Response waveform graph.
Figure 16 Limits
Hands-On Seminar
1-38
ni.com
Now you will add code so that each time the loop iterates, new Upper and Lower Limits will be used.
For the first iteration of the loop, the Upper Limit will be equal to the Start Limit. However, subsequent
loop iterations will decrease the Upper Limit by a set amount, which well call the Limit Step. To
determine the value of the Limit Step, use the following equation:
Stop Limit Start Limit
Limit Step =
Number of Steps 1
As it turns out, this equation is identical to the one used to calculate the Frequency Step in the previous
exercise. This provides the perfect opportunity to re-use code that you previously created.
7. You will select a portion of your block diagram and create a SubVI that you can re-use.
a. Switch to the block diagram of your VI.
b. Press and hold the <Shift> key and click on the Decrement, Subtract, and Divide functions
outside the loop of the block diagram. A moving dashed outline called a marquee will
highlight each function.
13.
Figure 17 Select Numeric functions
Tip: Alternatively, you can click and drag a selection box around the Subtract, Decrement, and
Divide functions.
c. With the Decrement, Subtract, and Divide functions highlighted, select Edit Create
SubVI. LabVIEW will replace the three functions that you selected with a new SubVI.
d. Double-click on the new VI that you just created. Looking at the front panel, notice that you
have three numeric controls on the left, and one numeric indicator.
1-39
Hands-On Seminar
e. Rename the controls and indicators of the new VI so that they arent specific to frequency.
i. Rename the Stop Frequency to Stop Value.
ii. Rename the Start Frequency to Start Value.
iii. Rename the Numeric to Step Value.
f.
Select Window Show Block Diagram to view the block diagram. Here you can see the
three functions and the controls and indicators wired just the way you had them. Creating
SubVIs is a powerful way to modularize your LabVIEW code.
g. Select File Save as and name the SubVI as Step Value Calculator.vi.
h. Click OK and close the VI and return to the block diagram of the FilterTest VI.
Hands-On Seminar
1-40
ni.com
8. Now you will use the Start Limit, Stop Limit, Number of Steps, and the new Step Value VI to
calculate the value of the Limit Step.
a. Right-click on the block diagram and select Select a VI.
b. Select Step Value Calculator.vi in your Exercises folder and click OK.
c. Place the VI to the right of the Stop Limit control.
Tip: Alternatively, you can click on the Step Value SubVI, copy it, and paste the copy on the
block diagram.
d. Wire the Number of Steps control to the Number of Steps input terminal (top left) of the
Step Value Calculator VI.
e. Wire the Stop Limit control to the Stop Value input terminal (middle left) of the Step Value
Calculator VI.
f.
Wire the Start Limit control to the Start Value input terminal (bottom left) of the Step Value
Calculator VI.
The Limit Step value has been calculated and is ready to be used in the For Loop. For each loop, the limit
used in the following loop will be calculated by adding the current limit to the Limit Step. This
calculation will vary the limits as the frequency increases.
Next Loop Upper Limit = Current Loop Upper Limit + Limit Step
9. You will use the Start Limit, Limit Step, Add function, and For Loop to calculate the value of the
next loops limits.
a. Right-click on the block diagram and select Numeric Add. Place the Add function towards
the bottom right of the For Loop.
b. Wire the output of the second Step Value VI (which is outside the For Loop) to the top input
terminal of the new Add function (inside the For Loop).
1-41
Hands-On Seminar
Figure 22 Wire the Step Value Calculator VI output to the Add function
c. Right-click on the Loop tunnel created by the wire from the Start Limit control and select
Replace with Shift Register.
d. Wire the Start Limit shift register that you just created to the second input of the new Add
function. This is easier to do if you start the wire at the Add function.
e. Wire the output of the Add function to the shift register on the right side of the For Loop.
Hands-On Seminar
1-42
ni.com
10. Double check that your block diagram is similar to the previous image. Save your VI.
11. Switch to the front panel.
12. Change the Stop Limit from 1.05 to 0.55, and select Edit Make Current Values Default.
13. Run the VI. The limit lines should gradually converge as the sweep progresses. The Pass LED should
also change to the Fail when the amplitude of the waveform is outside of the limits. If the VI isnt
running properly, double-check the block diagram or consult with the instructor.
1-43
Hands-On Seminar
b
a
3. Run your VI again. Now that the filter has been introduced, the waveform should increase in
frequency and decrease in amplitude. The waveform should stay within the green and blue limit lines
on the graph.
Hands-On Seminar
1-44
ni.com
14. The DUT has a jumper that can be moved to force the filter test to fail. If you move the jumper to
C4 or R2 the filter will be bypassed and the test will fail. Try running the test with the jumper
moved to simulate a bad filter.
1-45
Hands-On Seminar
c. Then left click on the Pass boolean indicator on your front panel. This associates the Pass
boolean control with the selected terminal of your VI.
d. Right-click on the connector icon again and select Show Icon.
Hands-On Seminar
1-46
ni.com
3. Now, resize the VI front panel to only show the Waveform Graph and Pass Boolean indicator. When
the VI is called as a popup panel by TestStand, only the waveform graph will be visible.
4. 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 dialog window, select Window Appearance in for the Category.
c. Select the Dialog radio button.
d. Select OK to save changes.
e. Run the VI to see how the window appears. This is how the VI will appear when called.
f.
Exercise 4B: Create a TestStand sequence and add the Filter Test step
1. Select Start All Programs National Instruments TestStand 2010 SP1.
2. After the TestStand Sequence Editor opens, a login dialog 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.
1-47
Hands-On Seminar
3. First you will select the LabVIEW adapter which allows you to call and run LabVIEW VI code
modules from TestStand. Select the LabVIEW adapter from the Adapter ring control.
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 C:\Program Files\National Instruments\TestStand
3.5\Components\NI\Models\TestStand Models and select
SequentialModel.seq.
5. Now you will insert your first step to the test sequence, which will test the filter on the DUT. The test
will return a Boolean value for the pass/fail result, so the type of test you want is a pass/fail test.
Right-click on the sequence view window, then select Insert Step Tests Pass/Fail Test.
Hands-On Seminar
1-48
ni.com
7. Now that youve select the type of step, you will need to specify which LabVIEW VI this step calls.
You will use the LabVIEW VI that you saved at the end of Exercise 3 as the code for this test.
a. In the Step Settings window below, click the Browse for VI button. This will bring up
the Edit LabVIEW VI Call dialog box. Here you will select the path of the LabVIEW VI
that this step calls.
Figure 31 Select a Pathname for the Step's Code Module dialog box
b. Select the FilterTest.vi file from your Exercises directory and click OK to return to
the Edit LabVIEW VI Call dialog box.
8. Now that you have selected the VI, you will need to define where to store the test result in TestStand.
a. Notice that the window on the right now shows the VI icon with an output terminal called
Pass. 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 and click the Expression Browse button, f(x) button
the right.
, to
c. This is the Expression Browser dialog box, which you can use to interactively build an
expression by selecting from lists of variables, properties, operators, and functions.
d. In this case, navigate the properties of the step and select Step.Result.PassFail.
Click Insert to select that property.
1-49
Hands-On Seminar
e. Step.Result.PassFail is the TestStand property that will now contain the Pass
value.
f.
Hands-On Seminar
1-50
ni.com
Exercise 4C: Add the LED Test step and interactively connect routes
1. Next, you will add a second step which will test the LED on the DUT. The test will return a numeric
value for the voltage that you will want to compare to limits, so the type of test you want is a numeric
limit test.
a. Right-click on the Filter Test step, then select Insert Step Tests Numeric Limit Test
as shown below.
b. Call the inserted step LED Test.
2. Just as you did for the previous test step, you will need to specify which LabVIEW VI this step calls.
Right-click on LED Test and select Specify Module.
a. In the Step Settings window below, click on the Select Express.
Tip: Express VIs can be called directly by TestStand. Remember from Exercise 2 that
Express VIs group low-level LabVIEW VIs into functional components that you can
configure through an interactive dialog box. In this case, you will use the niDMM Express VI
to specify acquisition properties and view the resulting data in the dialog box before inserting
the VI into your sequence.
b. From the menu that launches, click Browse and navigate to C:\Program Files
(x86)\National Instruments\LabVIEW 2011\vi.lib\express\NI ELVISmx\API.llb
c. On the window that prompts, select elvxp_mxDMMExpressBlock.vi from the list and
click OK
d. A configuration dialog box for NI ELVISmx DMM Express VI will open. Select the
corresponding ELVIS device and configure Measurement function to Diode as shown
in the next figure
Configuration Option
Value
Measurement function
Diode
1-51
Hands-On Seminar
3. Select Run Once. If the LED is connected properly and is functional, the displayed value will be
around 1.6 Volts. Also notice that the LED is lit.
4. Click the OK button to return to the Edit LabVIEW VI Call dialog box.
5. Next you will enter an expression that specifies where TestStand stores the numeric data that the VI
outputs.
a. In the Value field of the Measurement terminal, type in Step.Result.Numeric.
b. Step.Result.Numeric is the TestStand property that will now contain the measured
DMM value which will be compared to the limits we will define in the next step.
6. Now that the VI has been configured, you will want to define what values are within range and allow
the test to pass.
a. Click on the Limits tab in the Step Settings window.
b. Set the limits in the Edit Numeric Limit Test dialog box to the values shown in the next
figure. Setting the limits in this way will have this step fail only if the returned
measurement, the voltage value, is outside of 1.5V and 2.0V, which effectively tests for
shorts and opens.
Hands-On Seminar
1-52
ni.com
1-53
Hands-On Seminar
2. View the test results. Notice the status of the tests and the result of the LED Test measurement is
displayed.
NOTE: The LED will remain on after the test is complete.
3. To run another test, click Execute Restart.
4. Moving the jumper on DUT3 to a different position will make the filter fail. Move the jumper to C4
and run the sequence again using Execute Restart. View the test results to see that the Filter Test
failed.
Tip: Placing the jumper on the C4 or R2 jumper pins will cause the Filter Test to fail.
Hands-On Seminar
1-54
ni.com
5. Place the jumper back on the NONE jumper pin when finished.
6. Close the Single Pass window by pressing the Close button on the window or selecting Window
Close Completed Execution Displays when you are finished.
End of Exercise 4
1-55
Hands-On Seminar