18
We can see that the three buffers that were allocated (let's call them A at
0x7f3c32c54010
, B
at
0x7f3c2c4bf010
, and C at
0x7f3c2c37e010
) are used in a round-robin fashion: A → B → C →
A → B → C → ... This is the result of:
n
the FIFO nature of input and output buffer queues:
n
the Coaxlink driver pops a buffer from the front of the input queue, and gives it to the
Coaxlink card for DMA transfer;
n
when the transfer is complete, the buffer is pushed to the back of the output queue;
n
the use of
ScopedBuffer
:
n
the
ScopedBuffer
constructor pops a buffer from the front of the output queue (i.e., it
takes the oldest buffer);
n
the
ScopedBuffer
destructor pushes that buffer to the back of the input queue (hence,
this buffer will be used for a new transfer after all buffers already in the input queue).
5.3. Configuring the grabber
Configuration is a very important aspect of any image acquisition program.
n
The camera and the frame grabber both have to be configured according to the application
requirements.
n
The camera configuration must be compatible with the frame grabber configuration, and
vice versa.
Configuration basically boils down to a series of
performed on the grabber
modules: the remote device (i.e., the camera), the
, the
, or the
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>("CycleMinimumPeriod", 1e6 / FPS);
// 6
}
Coaxlink
Programmer Guide
5. Euresys::EGrabber