Programming instructions

Chapter 17 Shaking Hands with a Digital Partner
©
National Instruments Corporation 17-5 LabVIEW Data Acquisition Basics Manual
You can use only Intermediate or Advanced Digital VIs for digital
handshaking in LabVIEW. The Intermediate VIs work for most all
non-buffered and buffered digital handshaking applications. However, for
some DAQ devices, you may need to use a combination of Intermediate and
Advanced VIs.
Non-Buffered Handshaking
Non-buffered handshaking takes place when your program transfers one
digital value after receiving a digital pulse on the handshaking lines.
LabVIEW does not store these digital values in computer memory. You
should only use non-buffered handshaking when you expect only a few
digital handshaking pulses. For multiple-pulsed applications, you should
use buffered handshaking, which you can learn about in the next section of
this chapter,
Buffered Handshaking
. Figure 17-3 shows an example of
non-buffered handshaking using the Intermediate VI, DIO Single
Read/Write. In this example, LabVIEW reads the data from the digital
port(s).
Figure 17-3.
Non-Buffered Handshaking Using the DIO Single Read/Write VI
Typically, you want to put the DIO Single Read/Write VI inside a loop.
You can use the
iteration
input (the terminal where the loop iteration is
connected) to optimize your digital operation. When
iteration
is
0
(default), LabVIEW calls the Advanced VI, DIO Group Config, to
configure the port(s). If
iteration
is greater than zero, LabVIEW uses the
existing configuration, which improves performance. Every time your
program calls the DIO Group Config VI, the digital line values are reset to
their default values. If you want to set the digital line values once and keep
the same values from one loop iteration to the next, set
iteration
to
0
on the
first iteration of the loop, then set
iteration
to 1. When
group direction
is