Академический Документы
Профессиональный Документы
Культура Документы
Scenario
You must create a portion of a larger project. The lead developer gives
you the inputs of the VI, the algorithm and the expected outputs. Build
and document a VI based on the design given.
Design
Flowchart
Current Temp
No
>=Max Temp?
Yes
Warning Text =
Warning Text =
Heatstroke
No Warning
Warning
Current Temp
No
<= Min Temp?
Yes
Warning
Text = No No
Warning?
Yes
Implementation
Follow the instructions given below to create a front panel similar to Figure
3-14. This front panel retrieves from the user the current temperature, the
maximum temperature, and the minimum temperature, and displays to the
user the warning string and the warning Boolean LED. This VI is part of
the temperature weather station project you created in the previous exercise.
❑ Select File»Save.
Tip This subVI could be used for Fahrenheit, Kelvin, or any temperature scale, as long
as all inputs use the same scale. Therefore, it is not necessary to add scale units to the
labels.
❑ Hold down the <Ctrl> key and click and drag the Current Temp
numeric control to create a copy of the control.
❑ Change the label text of the new numeric control to Max Temp.
❑ Hold down the <Ctrl> key and click and drag the Max Temp
numeric control to create a copy of the control.
❑ Change the label text of the new numeric control to Min Temp.
6. Create a string indicator for the warning text.
Tip If you do not want to use the Icon Terminal view on the block diagram, select
Tools»Options, then select Block Diagram from the Category list. Remove the
checkmark from the Place front panel terminals as icons item.
Follow the instructions given below to build a block diagram similar to the
one shown in Figure 3-15.
❑ Wire the Max Temp terminal to the y input terminal of the Greater
Or Equal? function.
❑ Wire the Min Temp terminal to the y input terminal of the Less Or
Equal? function.
11. If the Current Temp is equal to or greater than the Max Temp, generate
a Heatstroke Warning string, otherwise generate a No Warning
string.
❑ Place the Select function on the block diagram to the right of the
Greater Or Equal? function.
❑ Hold down the <Ctrl> key and click and drag the Heatstroke
Warning string constant to the lower left of the Select function to
create a copy of the constant.
12. If the Current Temp is equal to or less than the Min Temp, generate a
Freeze Warning string, else use the string generated in Step 11.
❑ Create a copy of the Select function and place it to the right of the
Less Or Equal?.
❑ Create a copy of the string constant and place it to the upper right of
the Select function.
❑ Wire the output of the second Select function to the Warning Text
indicator.
❑ Wire the output of the Not Equal function to the Warning? Boolean.
15. Document the code using the following suggestions on the front panel.
❑ Create tip strips for each control and indicator stating the purpose of
the object and the units used. To access tip strips, right-click a
control, and select Description and Tip.
Testing
1. Test the VI by inputting a value for Current Temp, Max Temp, and
Min Temp, and running for each set.
Table 3-1 shows the expected Warning Text string and Warning?
Boolean for each set of input values.
30 30 10 Heatstroke True
Warning
25 30 10 No Warning False