![Euresys Coaxlink Series Programmer'S Manual Download Page 21](http://html1.mh-extra.com/html/euresys/coaxlink-series/coaxlink-series_programmers-manual_2436137021.webp)
21
Counters
Coaxlink firmware counts each occurrence of each event (except
new buffer
events) and makes
this counter available in a GenApi feature named
EventCount
. Each event has its own counter,
and the value of
EventCount
depends on the selected event:
// select the CameraTriggerRisingEdge event
grabber.setString<DeviceModule>("EventSelector", "CameraTriggerRisingEdge");
// read the value of the counter
int64_t counter = grabber.getInteger<DeviceModule>("EventCount");
or, using the
selected feature
notation:
// read the value of the CameraTriggerRisingEdge counter
int64_t counter = grabber.getInteger<DeviceModule>("EventCount
[CameraTriggerRisingEdge]");
Notifications
As we've just seen, when an event occurs, a dedicated counter is incremented. Coaxlink can
also notify the application of this event by having
Euresys::EGrabber
execute a user-defined
. But first, it is required to enable notifications of one or more events:
grabber.setString<DeviceModule>("EventSelector", "CameraTriggerRisingEdge");
grabber.setInteger<DeviceModule>("EventNotification", true);
grabber.setString<DeviceModule>("EventSelector", "CameraTriggerFallingEdge");
grabber.setInteger<DeviceModule>("EventNotification", true);
...
or:
grabber.setInteger<DeviceModule>("EventNotification[CameraTriggerRisingEdge]", true);
grabber.setInteger<DeviceModule>("EventNotification[CameraTriggerFallingEdge]", true);
...
Using a
, it is easy to enable notifications for all events:
function enableAllEvents(p) {
// 1
var events = p.$ee('EventSelector');
// 2
for (var e of events) {
p.set('EventNotification[' + e + ']', true);
// 3
}
}
var grabber = grabbers[0];
enableAllEvents(grabber.InterfacePort);
// 4
enableAllEvents(grabber.DevicePort);
// 5
enableAllEvents(grabber.StreamPort);
// 6
1. Define a helper function named
enableAllEvents
and taking as argument a module (or
port)
p
.
2. Use the
$ee
function to retrieve the list of values
EventSelector
can take. This is the list of
events generated by module
p
. (
ee
stands for
enum entry
.)
3. For each event, enable notifications. (The
+
operator concatenates strings, so if
e
is
'LIN1'
,
the expression
'EventNotification[' + e + ']'
evaluates to
'EventNotification
[LIN1]'
.)
5. Euresys::EGrabber
Coaxlink
Programmer Guide