signals up to 5 MHz and
can also be configured as
an external trigger.
Also on the digital
side is a +2.5 VDC at 1
mA terminal, a + 5 VDC at
200 mA, and a ground
terminal. The +2.5 VDC
1 mA terminal is for
calibrating the A-to-D
channels. On the analog
side of the devices are 16
terminals, as well. There
are four analog input
FIGURE 3
ports, AI0 through AI3,
each with a positive,
negative, and ground terminal. When these ports are
configured as differential inputs, they have 12 or 14 bit
resolution (depending on the model). When they are
configured as single-ended inputs, a total of eight individual
analog voltages can be converted at one bit less in
resolution. There are also two analog output channels,
AO0 and AO1; these have a 12-bit resolution and can
output an analog voltage from 0V up to 5V at a maximum
of 150 Hz. (The analog features of the unit will not be
covered until Part 4 of this series.)
Before you connect the unit to your PC, you must first
install the NI-DAQmx drivers from the two CDs included
with the unit. After the drivers are installed, a pop-up menu
should appear when you plug the unit into a USB port on
your computer (see Figure 1). From this menu, you can test
the USB device, as well as several other choices. If you are
having problems with your unit later on, you may try to
resolve these problems through this menu; for now, we
will close this pop-up menu and begin building a VI for the
USB hardware.
FIGURE 4
front panel, place an array by selecting: Modern>Array,
Matrix & Cluster>Array from the controls palette (see Figure
2). Next, place a toggle switch in the box to the right of the
array by selecting: Express>Buttons and Switches>Toggle
Switch (see Figure 3). Now, stretch the array with the
toggle switch in it down until four toggle switches are
visible, as shown in Figure 4.
Using the pointer finger cursor, select this from the
tools palette; click on the bottom toggle switch in the array.
If you do this correctly, the toggle switches will change
from a grayed-out color to a more solid color. Add a
stop button to the front panel at this time by selecting:
Express>Buttons and Switches>Stop. Now, you will need to
work in the block diagram window to complete the VI.
Write Some Code
Build A Framework
Let’s make a simple VI that can be used to output four
digital signals to control four LEDs connected to Port0.
Begin by opening LabVIEW and selecting Blank VI. If you
are having trouble starting a new VI, refer to Part 1. On the
In the block diagram window, click and drag out a
while loop by selecting: Programming>Structures>While
loop from the functions palette. Be sure to place both the
stop button and the array icons inside the while loop. Wire
the stop button to the stop icon in the lower right corner of
the while loop. You will now need to use the DAQ Assistant
to set up the USB unit for use by selecting: Express>
Output>DAQ Assistant.
When you place the DAQ Assistant inside the while
loop, it will open up a series of pop-up windows to step
FIGURE 5
FIGURE 6
FIGURE 7
SERVO 04.2009
39