Exercise 4 Add Analysis and Digital Output to the DAQ Application

advertisement
Exercise 4: Add Analysis and Digital Output to the DAQ Application
Set up Hardware
1. Confirm that the myDAQ chassis is connected to the PC via the USB cable. If not, or if it is not behaving as expected,
repeat steps #1-8 from Exercise #3
LabVIEW Application – Compare signal to user-defined alarm
2. Exercise 4 is functionally the same as the end result of Exercise 3. You can open Exercise 4 to synchronize with the
illustrations in this section. Open 4-Analysis and Output.vi from the Exercises folder in the Project explorer. The VI will
appear like the image below, with additional space on the block diagram to add functionality: I HAVE ADDED A
SCALING FUNCTION TO GIVE US CORRECT TEMPERATURE.
3. Create an alarm that signals if acquired temperature goes above a user-defined level. On the front panel, right-click
to open the Controls palette Programming» Numeric and place a numeric control on the front panel.
4. Change the numeric control's name to "Alarm Level." Double-click on the control's label and replace the generic text
with "Alarm Level"
6. Use the Comparison Express VI to compare the acquired temperature signal with the Alarm Level control. Switch to
the block diagram, right-click on an empty space and open the Functions palette. Place the Comparison Express VI on
the block diagram from Functions» Express» Arithmetic & Comparison» Comparison.
7. Once placed on the block diagram, the Comparison Express VI's configuration dialog will appear.
Select "> Greater" in the Compare Condition section and "Second signal input" from the Comparison Inputs section then
click OK.
8. Connect the acquired temperature data and Alarm Level inputs to the Comparison Express VI. Hover over the output
of the DAQ Assistant until the spool icon appears on your cursor, then left-click and drag you mouse to the Operand 1
input on the Comparison Express VI. Perform the same hover, drag and connect to wire the Alarm Level control and the
Operand 2 input on the Comparison Express VI. Your block diagram should now look like this:
9. Display the result of the Comparison Express VI on the front panel. On the front panel, right click, open the Controls
palette and add a Square LED indicator. The square LED is found at Controls» Modern» Boolean. Resize the Square LED
so that it is easier to see and rename it "Alarm." Your front panel should look like this:
On the block diagram, wire the output of the Comparison Express VI to the input of the Alarm indicator's terminal.
10. Run the application. Press the Run button and then change the Alarm Level control to some level above the current
acquired temperature signal. Hold the temp sensor until the temperature exceeds the Alarm Level value. The Alarm
LED turns on when the acquired temperature signal goes above the level set on the front panel.
End of Exercise 4
Download