Euresys::EGrabber Coaxlink Programmer's Guide
• the Coaxlink driver pops a buffer from the front of the input queue, and gives it to the Coaxlink card for DMA
transfer;
• when the transfer is complete, the buffer is pushed to the back of the output queue;
• the use of ScopedBuffer:
• the ScopedBuffer constructor pops a buffer from the front of the output queue (i.e., it takes the oldest buffer);
• the ScopedBuffer destructor pushes that buffer to the back of the input queue (hence, this buffer will be used
for a new transfer aer all buffers already in the input queue).
Configuring the grabber
Configuration is a very important aspect of any image acquisition program.
• The camera and the frame grabber both have to be configured according to the application requirements.
• The camera configuration must be compatible with the frame grabber configuration, and vice versa.
Configuration basically boils down to a series of set/get operations performed on the grabber modules: the remote
device (i.e., the camera), the interface, the device, or the data stream modules.
This program configures the grabber for the so-called RG control mode (asynchronous reset camera control, frame
grabber-controlled exposure).
#include <iostream>
#include <EGrabber.h>
const double FPS = 150;
void configure() {
Euresys::EGenTL gentl;
Euresys::EGrabber<> grabber(gentl);
// camera configuration
grabber.setString<Euresys::RemoteModule>("TriggerMode", "On"); // 1
grabber.setString<Euresys::RemoteModule>("TriggerSource", "CXPin"); // 2
grabber.setString<Euresys::RemoteModule>("ExposureMode", "TriggerWidth"); // 3
// frame grabber configuration
grabber.setString<Euresys::DeviceModule>("CameraControlMethod", "RG"); // 4
grabber.setString<Euresys::DeviceModule>("CycleTriggerSource", "Immediate"); // 5
grabber.setFloat<Euresys::DeviceModule>("CycleTargetPeriod", 1e6 / FPS); // 6
}
int main() {
try {
configure();
} catch (const std::exception &e) {
std::cout << "error: " << e.what() << std::endl;
}
}
1. Enable triggers on the camera.
2. Tell the camera to look for triggers on the CoaXPress link.
3. Configure the camera to use the TriggerWidth exposure mode.
4. Set the frame grabber's camera control method to RG. In this mode, camera cycles are initiated by the frame
grabber, and the exposure duration is also controlled by the frame grabber.
5. Tell the frame grabber to initiate camera cycles itself (at a rate defined by CycleTargetPeriod), without waiting
for hardware or soware triggers.
6. Configure the frame rate.
But there is a better way to configure the grabber. Using a script file, the program becomes:
#include <iostream>
15