FIGURE 9
FIGURE 11
/
-. -
- -,
FIGURE 10
FIGURE 12
the 10K potentiometer from the circuit first. Now when you
run the VI, you will see the output of the LM34 which is 10
mV/°F; so if the room temperature is 72°F, you will see 720
mV in the numeric indicator display. If we multiply that value
by 100, we convert that voltage to °F and can display that
in the thermometer on the front panel. Add a thermometer
to the front panel by selecting from the controls palette:
Express>Numeric Indicators>Thermometer. In the block
diagram, add a multiplication function from the functions
palette by selecting: Express>Arith &
Com…>Numeric>Multiply. Wire the data terminal
from the DAQ Assistant to one of the multiplication inputs on its left side. Wire the output of
the multiplication icon on its right side to the
input of the thermometer input. Now hold your
cursor over the unconnected input of the multiplication icon and right click. From the pop-up menu,
select the create constant. In the constant box that
appears with a zero in it, type in the number 100
and press enter. When the VI is run, the thermometer will now
display the temperature of the LM34 in °F (see Figure 11).
Let’s add a second analog channel to the VI with an LDR
connected as shown in Figure 12. We will also need to add an
additional numeric indicator to the front panel to display the LDR’s
voltage. If, however, we attempt to open another analog input
DAQ Assistant, we will get an error when we try to run the VI.
We must open the current DAQ Assistant, and add an additional
analog input channel to it by selecting the blue “plus sign” from
the DAQ Assistant pop-up as shown in Figure 13 then selecting
channel AI1 as shown in Figure 14. Now we need to split the
data coming from the DAQ Assistant data terminal out to two
separate indicators: the thermometer and numeric indicator
for channel AI0 and a numeric indicator for channel AI1.
To do this, delete the wiring between the DAQ Assistant
and the thermometer and its numeric indicator. Add a
splitter by selecting from the functions palette: Express>Sig
Manip>Split Signals. Grab the lower edge of the signal splitter
icon and drag it down until three terminals appear: one
input and two outputs. Now you can wire the DAQ
Assistant data to the input terminal and the two
output terminals to the thermometer and the
numeric indicator for the LDR (see Figure 15).
FIGURE 14
Output, Too!
FIGURE 13
FIGURE 15
Finally, let’s control an analog voltage coming
out from the USB-6008 unit. We can add another
DAQ Assistant to control an analog output from
one or both of the analog output channels, AO0
and AO1. Add a knob to the front panel to control
an analog output voltage by selecting from the
controls palette: Express>Num Ctrls>Knob. In the
block diagram, add another DAQ Assistant and when
its pop-up menus appear, select Generate Signals>
Analog Output>voltage
as shown in Figure 16.
Select channel AO0 as
shown in Figure 17. In
the final pop-up menu,
change the generation
mode to one sample
(on demand) as in
Figure 18. Now in the
block diagram, wire
the knob’s icon to the
DAQ Assistant as
shown in Figure 19.
FIGURE 16
56 SERVO 06.2009