High-Level Signal I/O Functions

NI IMAQ

High-Level Signal I/O Functions

The signal I/O functions fall into two categories—triggering acquisitions and driving the trigger lines. Use triggered acquisitions to acquire images precisely when an external event occurs, such as a sensor activating. Driving trigger lines allows you to control external devices in sync with the image acquisition. For example, you can fire a strobe light before the acquisition of each frame in a sequence.

You can initiate any of the four types of acquisitions from an external trigger source by using imgSessionTriggerConfigure. For sequence and ring acquisitions, you can choose to trigger only the first buffer in the list, or you can choose to trigger each buffer in the list. After you use this function to set up the trigger, any acquisition performed on the session waits for a trigger. Use imgSessionTriggerClear to remove the trigger settings from the session.

Many machine vision cameras support asynchronous reset, which is an immediate frame output after a trigger. Most camera files supplied by National Instruments program the image acquisition device to send this trigger through the camera control lines. For applications using asynchronous reset, the external trigger signal should be routed to the image acquisition device, and imgSessionTriggerConfigure should be called to setup the device to trigger the camera.

Some applications need to send signals out from the image acquisition hardware to an external device. You can drive many types of signals out of the trigger lines by using imgSessionTriggerDrive. The parameters of this function include a trigger line number, the polarity of the line, and what to drive on the line. You can use a steady state value of high or low or one of the internal state signals of the hardware, such as acquisition in progress. When you need to generate specific pulses, use imgPulseCreate and imgPulseStart.

The following figure shows the outline of a program that waits for an external trigger on line 1 before acquiring a single image. The program 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.