0% found this document useful (0 votes)
15 views8 pages

LabView Exercises (1) - 1

Uploaded by

jroman227
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views8 pages

LabView Exercises (1) - 1

Uploaded by

jroman227
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

ME 403 LabView Exercise 1 Spring 2020

Build a VI
Complete the following steps to create a VI that takes a number representing kilometers per hour
and converts it to numbers representing miles/hour, feet/second, and furlongs/fortnight
Front Panel
1. Select File»New VI to open a new front panel.

2. (Optional) Select Window»Tile Left and Right to display the front panel and block
diagram side by side.
3. Create a numeric digital control. You will use this control to enter the value for miles per
hour (mph).
a. Right click on the Front Panel to bring up the Controls palette.
Select the digital control on the Controls»Express»Numeric Controls palette.
b. Move the control to the front panel and click to place the control.
c. Type kph inside the label and click outside the label. If you do not type the
name immediately, LabVIEW uses a default label. You can edit a label at any
time by using the Labeling tool.
4. Create three numeric digital indicators. You will use these indicators to display the
values for mph, fps, and furlongs/fortnight.
a. Select the digital indicator on the Controls»Express»Numeric
Indicators palette.
b. Move the indicator to the front panel and click to place the indicator.
c. Type mph inside the label and click outside the label.
d. Repeat for fps and furlongs/fortnight.
LabVIEW creates corresponding control and indicator terminals on the block diagram.
The terminals represent the data type of the control or indicator. For example, a DBL
terminal represents a double-precision, floating-point numeric control or indicator.
Not e Control terminals have a thicker border than indicator terminals.

ME 403 Labview Exercises


Block Diagram
5. Display the block diagram by clicking it or by selecting Window»Show Block
Diagram.

Note: Block Diagram terminals can be viewed as icons or as terminals. To change the way
LabVIEW displays these objects right click on a terminal and select View As Icon.

6. Right click on the block diagram window and go to the Functions»Express»Arithmetic


and Comparison»Numeric palette and find the multiplication and division functions and place
them on the block diagram
7. Select the numeric constant on the Functions»Express»Arithmetic and
Comparison»Numeric palette and place five of them on the block diagram. When you first
place the numeric constant, it is highlighted so you can type a value.
8. Type in the constants as shown above. If you moved the constants before you typed a value,
use the Labeling tool to enter the values. If the constants are integer with no decimal point they
will appear in a blue box.
9. Use the Wiring tool to wire the icons as shown in the previous block diagram.
• To wire from one terminal to another, use the Wiring tool to click the first terminal, move
the tool to the second terminal, and click the second terminal, as shown in the following
illustration. You can start wiring at either terminal.

ME 403 Labview Exercises


• You can bend a wire by clicking to tack the wire down and moving the cursor in a
perpendicular direction. Press the spacebar to toggle the wire direction.
• To identify terminals on the nodes, right-click the Multiply and Add functions and select
Visible Items»Terminals from the shortcut menu to display the connector pane. Return
to the icons after wiring by right-clicking the functions and selecting Visible
Items»Terminals from the shortcut menu to remove the checkmark.
• When you move the Wiring tool over a terminal, the terminal area blinks, indicating
that clicking will connect the wire to that terminal and a tip strip appears, listing the
name of the terminal.
• To cancel a wire you started, press the <Esc> key, right-click, or click the source terminal.
10. Display the front panel by clicking it or by selecting Window»Show Front Panel.
11. Save the VI.
a. Select File»Save.
b. Navigate to your USB thumb drive
c. Type Velocity Conversion.vi in the dialog box.
d. Click the Save button.
12. Enter a number in the digital control and run the VI.
a. Use the Operating tool or the Labeling tool to double-click the digital control
and type a new number.
b. Click the Run button to run the VI.
c. Try several different numbers and run the VI again.
13. Select File»Close to close the Convert Velocity Converstion VI.

End of Exercise

ME 403 Labview Exercises


Exercise 2 - Using Waveform Graphs
Front Panel
1. Open a new VI and build the following front panel using the following tips.

a. Create a waveform graph indicator from the Controls»Express»Graph Indicators


palette. Use the position/size/select tool to move the plot legend to the side, and
expand it to display two plots. Use the labeling tool to change the plot names and the
properties page to choose different colors for your plots.
b. Place a vertical pointer slide from the Controls»Express»Numeric Controls palette.
Use the properties page again to change the slide fill color. Also place a knob
control from the same palette.
Block Diagram
2. Build the following block diagram.

ME 403 Labview Exercises


a. Place a While Loop from Functions»Execution Control palette.
b. Place a Wait Until Next ms Multiple from Functions»Programming
»Timing pallet and create a constant with a value of 1000.
c. Place two Simulate Signal Express VIs from the Functions»Input pallet and
leave the Signal type as Sine for the first Simulate Signal VI and change the Signal
Type to Square for the second VI. Wire both of the outputs into the waveform
graph. A Merge Signals function will automatically be inserted.
d. Connect the pointer slide and the knob to the frequency input on the upper left side
of the signal simulators. It is the second from the top and the identifying label will
show where to go to connect a wire end to it.
3. Save the VI as Multiplot Graph.vi.
4. Display the front panel and run the VI.

5. Save and close the VI.

End of Exercise

ME 403 Labview Exercises


Exercise 3 – Signal Processing and File Output
Front Panel
1. Open a new VI and build the following front panel using the following tips.

a. Create a waveform graph indicator from the Controls»Express»Graph


Indicators.
b. Place a vertical pointer slide from the Controls»Express»Numeric Controls
palette. Label it Input Frequency.
c. Place a numerical input box from the Controls»Express»Numeric Controls
palette. Label it Input Amplitude.
d. Place two box Numerical Indicators from the Controls»Express»Numeric
Indicators palette. Label one Output Frequency and the other Output
Amplitude.
e. Place a Vertical Toggle Switch from the Controls»Express»Buttons palette
and adjust its size to be similar to that shown. Label the switch Waveform File.
Use the label tool to put the words save and don’t save as shown.
f. Place a Vertical Toggle Switch from the Controls»Express»Buttons palette
and adjust its size to be similar to that shown. Label the switch Values File.
Use the label tool to put the words save and don’t save as shown.

Block Diagram

2. Build the following block diagram using the following tips.


a. Place a Simulate Signal Express VIs from the Functions»Input pallet and
leave the Signal type as Sine. Set the sampling rate at 5000 Hz and the number
of samples to 10,000.

ME 403 LabView Exercises


b. Connect the Input Frequency Slider and the Input Amplitude slider to the
corresponding points on the Signal Simulator.

c. Place a Tone Measurements block from the Functions»Signal Analysis pallet


and connect the output of the Signal Simulator to the Signals input of the Tone
module.
d. Connect the two output indicators, one for amplitude and one for frequency, to
the corresponding outputs of the Tone module.
e. Connect the output of the Signal Simulator to the input of the Waveform Graph
module.
f. Place two Write to Measurement File modules from the Functions»Outputs
palette. Label one Waveform File and the other Frequency and Amplitude file.
Connect the appropriate outputs from the Tone module to the input of the
ME 403 LabView Exercises
correct Write to Measurement File module. A Merge Signals function should
automatically be inserted for the Frequency and Amplitude file.
g. Connect the output of the Values File switch to the enable point on the
Frequency and Amplitude Write to Measurement File module.
h. Connect the output of the Waveform switch to the enable point on the
Waveform Write to Measurement File module.
3. Test and debug your VI until all errors are eliminated and all items function. Test to
see that you can record and recover data files and experiment with the output
parameters from the Write to Measurement File modules. You must insert a unique
filename beginning with your initials in the file setup menu to store your files.
4. Save the VI as Waveform Analysis.VI. You will be using a portion of this VI in
experiments that follow.
5. Close the VI.

End of Exercise

ME 403 LabView Exercises

You might also like