Triggering

NI IMAQ

Triggering

You may need to coordinate a vision event with events that are occurring outside the computer, such as receiving a strobe pulse for lighting or an infrared detector pulse indicating the position of an item on an assembly line. Any TTL-level signal can serve as a trigger for image acquisition devices. All of the lines are fully bidirectional, allowing your image acquisition device to generate or receive the triggers on any line. Use Real-Time System Integration (RTSI) triggers to coordinate the image acquisition device with other National Instruments devices, such as data acquisition (DAQ) devices.

You can configure triggers during both design time and run-time. At design time, use the Signal I/O property page of the CWIMAQ control to configure the triggers. At run-time, use the CWIMAQSignals object, which you can access through CWIMAQ.Signals to configure the triggers.

Each CWIMAQSignal object that is added to the CWIMAQSignals collection corresponds to a trigger line that you want to configure. The CWIMAQSignal.Line property specifies which external or RTSI trigger receives the incoming trigger signal. Each trigger line has a programmable polarity that is specified with CWIMAQSignal.Polarity. Use the CWIMAQ.FrameTimeout property to specify the amount of time to wait for a trigger. When you have configured the triggers, you can perform any acquisition described above. The following code illustrates the use of a trigger to control your acquisition:

Private Sub Start_Click()

'Capture an image on a trigger on RTSI line 0

CWIMAQ1.Signals.Add.Initialize cwimaqRTSI,_ cwimaqCaptureStart,

cwimaqActiveHigh, 0

End Sub