output data to an indicator.
Let’s add four LEDs to the front panel to display the
status of the external DIP switches connected to the
USB-6008 unit. On the front panel, add an array again by
selecting: Modern>Array Matrix…>Array from the controls
palette. Place an LED in the box on the right side of the
array by selecting: Express>LEDs>and either a square or
round LED. Now, stretch the array either down or to the
right until four LEDs are visible.
Now, click on the last LED with the pointer finger cursor to set the size of the array to four; remember that the
LEDs will change from a grayed-out color to a more solid
color when this is done correctly. Go back into the block
diagram window and wire the output of the second DAQ
Assistant to the input of the LED array (see Figures 11 and
12). When you run the VI, you should see the LEDs turn ON
and OFF as you toggle your external DIP switches.
We can now control external devices and acquire data
from digital inputs, however, these must all be TTL types of
signals at this point; that is, + 5 VDC and ground. Part 3 will
introduce devices that can step these signals up to higher
voltage AC and DC levels, such as 120 VAC.
The easiest way to demonstrate the 32-bit digital
counter input will be to loop back one of the digital output
terminals (such as P0.0) to the PFI0 input; each time the
P0.0 toggle button is pressed or cycled On and OFF, the
counter should increment by one. On the front panel, place
another numeric indicator by selecting: Express>Num
Inds>Num Ind (see Figure 13). Now, in the block diagram
place a third DAQ Assistant by selecting:
Express>Input>DAQ Assist. From the DAQ Assistant
windows that appear, select: Acquire Signals>Counter
Input>Edge Count. You’ll also see other types of counter
options such as frequency, period, etc.; however, the
USB-6008( 9) units only support the edge counter option.
Next, wire the data output terminal of this third DAQ
Assistant to the input of the numerical indicator, as shown
in Figure 14.
To test your counter, you can wire the P0.0 output
terminal back into the PFI0 terminal; you will see the
numeric indicator increment each time that output is
turned ON and then OFF again. You can also feed a TTL
compatible (+5V and ground) function generator output to
the PFI0 terminal on the USB-6008. You will see the number
of cycles completed as you run the VI. With a 32-bit
counter, the device can count up to 232 or 4. 29 X 109
And Coming Up...
As mentioned earlier, the next part in this series will
take what was done here and add additional external
hardware to boost the outgoing digital signals and
condition the incoming digital signals to real-world voltages
such as 12 VDC and even 120 VAC. SV