Applies to: PL-A741, PL-A741-BL, PL-A742, PL-A742-BL
Description
Synchronized image capture can be performed between two PL-A741 cameras, with simple cabling and no external components. See the diagram below to view the cabling diagram and refer to the hardware specs regarding the machine vision connector, if needed. In essence, the programmable output from one camera is used as an input trigger into itself, and one or more other cameras. There is also a sample C++ project that uses the API functions to control the image capture using the same cable connections.
Cabling
The PL-A741 cameras have a 6-pin Hirose connector in the back for external control. This diagram shows the pin-outs on that connector, and how they can be connected together to make the synchronized capture work. While it is best to use a custom cable, with Hirose connectors for any production system, it is possible, during prototyping, to test this scenario using a few simple pieces of wire, inserted into the correct pins.
The camera with the connector on the left must be identified as the primary camera, as it is the one that will send out the trigger signals from GP2 (pin 6).
PixeLINK Capture OEM Test Method
To make the two cameras capture a sequence of frames, it is necessary to setup the camera parameters in the following manner, using PixeLINK Capture OEM to test the procedure.
For the both cameras, define the Region of Interest (ROI), Decimation, Frame Rate, Data Format, and Shutter (integration)Time to suit your requirements. Keep in mind, there are limitations on the bandwidth available when running two cameras on the same FireWire OHCI card. It is also important to understand the frame rate and shutter time, and the time required to output a frame, so that the camera input triggers are coming at an appropriate interval.
Preview both cameras in Free Running mode, using the External Control tab, to frame and focus the camera. If you're unable to preview both images then you'll need to adjust the shutter (exposure) time, ROI size, and frame rate, on the Basic Controls tab, until you're able to see both images without interruption.
Once the imaging characteristics are defined for both cameras, use the External Control tab to put them both into Hardware Trigger mode, with Trigger Mode 0. The preview windows for each camera will say “Input Unavailable”.
Next, select the camera that is the primary camera, using the dropdown menu in the External Control tab. Chose GPO Number 2, and enable it. Define the following settings for the primary camera:
Mode | Pulse |
Polarity | Positive |
Number | 20 |
Duration | 0.005 |
Interval | 0.1 |
Click on the button labeled “Update GPO” – the camera preview windows will display a brief sequence of frames. Each time the Update GPO button is clicked, the cameras will return the brief sequence of frames.
Sample Application Method
Before making the two cameras with the sample C++ application, the steps above should be tested.
Once tested, you'll need to identify the cameras for the sample application. On the Camera Menu, select the option to Set Camera Name. With the primary camera selected, set the camera name to be “Main”.
Most of the parameters for the sample application are defined in the top portion of the TriggerSynchDemo.cpp file. The code is fully documented, to make it fairly easy to understand. It uses callback functions to ensure that the frames from each camera are added to the memory buffer for each specific camera. After the capture sequence is complete, the images stored in memory are individually extracted and saved to disk as sequentially numbered.
The purpose of this sample application is to illustrate one programmatic approach that can be used to control synchronized capture. Refer to the source code comments for additional details on how to customize the behaviour of the application.
The cameras can be used with either trigger mode 0 or with trigger mode 1. If trigger mode 1 is selected, then the output pulse width from the GP2 pin is the controlling factor over the shutter (integration) time.
It is important to monitor the camera parameters that are defined within the application, to ensure they do not conflict with one another. For example, requesting a shutter time of 100 ms, and generating triggers every 75 ms will result in irregular timings. Requesting a frame rate of more than 9 fps for each camera, if they are running at full resolution without decimation, will not work. However, by selecting decimation x2 will permit each camera to operate at 20 fps. Also monitor the definitions used for pulse width and interval. Be sure to review the bandwidth requirements and timing diagram to avoid any problems.