19
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
CycleMinimumPeriod
), without waiting for hardware or software triggers.
6. Configure the frame rate.
But there is a better way to configure the grabber. Using a
, the program becomes:
#include <iostream>
#include <EGrabber.h>
void configure() {
Euresys::EGenTL gentl;
Euresys::EGrabber<> grabber(gentl);
grabber.runScript("config.js");
}
int main() {
try {
configure();
} catch (const std::exception &e) {
std::cout << "error: " << e.what() << std::endl;
}
}
and the configuration script is:
var grabber = grabbers[0];
var FPS = 150;
// camera configuration
grabber.RemotePort.set("TriggerMode", "On");
grabber.RemotePort.set("TriggerSource", "CXPin");
grabber.RemotePort.set("ExposureMode", "TriggerWidth");
// frame grabber configuration
grabber.DevicePort.set("CameraControlMethod", "RG");
grabber.DevicePort.set("CycleTriggerSource", "Immediate");
grabber.DevicePort.set("CycleMinimumPeriod", 1e6 / FPS);
Using a script file has several advantages:
n
The configuration can be changed without recompiling the application. This allows shorter
development cycles, and makes it possible to update the configuration in the lab or in the
field.
n
The configuration script can be loaded by the GenICam Browser and the command-line
gentl
tool. This makes is possible to validate the configuration outside of the user
application.
5. Euresys::EGrabber
Coaxlink
Programmer Guide