Chapter 3 Programming with NI-IMAQ
©
National Instruments Corporation 3-13 NI-IMAQ User Manual
the most recent video image. This process will continue until a designated
condition is met and then the acquisition stops.
High-Level Signal I/O Functions
The signal I/O functions fall into two categories, triggering acquisitions
and driving the external trigger lines. Triggered acquisitions allow images
to be acquired precisely when an external event occurs, such as a sensor
activating. The driving of external trigger lines allows external devices to
be controlled in sync with the image acquisition. For example, a strobe light
could be fired when a sequence acquisition begins.
Any of the four types of acquisitions can be initiated from an external
trigger source by using imgSessionTriggerConfigure. For sequence
and ring, just the first buffer in the list can be triggered or each buffer in the
list can be triggered. After using this function to set up the trigger, any
acquisition performed on the session will wait for a trigger. Use
imgSessionTriggerClear to remove the trigger settings from the
session.
Some applications need to send signals out from the IMAQ hardware to an
external device. Many types of signals can be driven out of the trigger lines
by using imgSessionTriggerDrive. This function takes a trigger line
number, the polarity the line should be driven, and what to drive on the line.
This can be a steady state value of high or low or it can be one of the internal
state signals of the hardware, such as acquisition in progress. When specific
pulses need to be generated, imgPulseCreate and imgPulseStart can
be used.
Figure 3-6 shows the outline of a program that waits for an external trigger
on line 1 before acquiring a single image. It also configures the driver to
assert RTSI trigger line 3 when the acquisition is finished. The
trigsnap.c example contains C code that implements this program.
UM.book Page 13 Monday, July 13, 1998 9:49 AM