Page 2
EURESYS s.a. shall not be liable for any loss of or damage to revenues, profits, goodwill, data, information systems or other special, incidental, indirect, consequential or punitive damages of any kind arising in connection with the use of the hardware or the software of EURESYS s.a.
3.1. System module 3.2. Interface module 3.3. Device module 3.4. Data stream module 3.5. Buffer module 3.6. GenTL API 4. Euresys::EGenTL 4.1. A first example 4.2. Relevant files 5. Euresys::EGrabber 5.1. A first example 5.2. Acquiring images 5.3. Configuring the grabber 5.4.
Page 4
Coaxlink Programmer Guide 6. Euresys GenApi scripts 6.1. doc/basics.js 6.2. doc/builtins.js 6.3. doc/grabbers.js 6.4. doc/module1.js 7. EGrabber for MultiCam users 8. .NET assembly 8.1. A first example 8.2. Differences between C++ and .NET EGrabber 8.3. Single thread callbacks 9. Definitions...
1. Introduction Coaxlink Programmer Guide 1. Introduction The Application Programming Interface (API) for Coaxlink cards is based on GenICam. The goal of GenICam is to provide a standardized, uniform programming interface for using cameras and frame grabbers based on different physical interfaces (CoaXPress, GigE Vision, etc.) or from different vendors.
EMVA provides a reference implementation, but it is fairly difficult to use, and logging is very poor. Instead, we recommend using the Euresys implementation bundled with the Coaxlink software package. This implementation also allows writing powerful configuration scripts. Features What the user gets from GenApi is a bunch of named features, organized in categories.
Page 7
2. GenApi Coaxlink Programmer Guide Commands There is also another kind of features: commands (e.g., ). Commands are AcquisitionStart special: they don't have any associated value; they have side effects. Command features are meant to be executed. When a command is executed, some action happens in the camera (e.g., a software trigger is generated).
Coaxlink Programmer Guide 3. GenTL 3. GenTL GenTL defines 5 types of objects, organized in a parent/child relationship: the system module the interface module the device module the data stream module the buffer module Each module: ● corresponds to a particular element of the system; ●...
This module is at the top of the parent/child tree. coaxlink.cti The system module provides basic information about the GenTL producer: things like the complete path to and the vendor name (Euresys). coaxlink.cti The real point of the system module is to list the interfaces (or frame grabbers) present in the system.
Instead of using the GenTL API directly, we recommend using either: library which deals with these complications so that the user doesn't Euresys::EGenTL have to; or the library which provides a high-level, easy-to-use interface.
4. Euresys::EGenTL Coaxlink Programmer Guide 4. Euresys::EGenTL is a library of C++ classes that provide the same functionality as standard Euresys::EGenTL GenICam GenTL, but with a more user-friendly interface. For example, it uses std::string instead of raw pointers, and error codes are transformed into exceptions.
Coaxlink Programmer Guide 4. Euresys::EGenTL Some GenTL functions retrieve information about the camera or frame grabber. These functions fill a buffer with a value, and indicate in an the actual void * INFO_DATATYPE type of the value. uses C++ templates to make these functions easy to...
4. Euresys::EGenTL Coaxlink Programmer Guide 1. Include , which contains the definition of the class. EGenTL.h Euresys::EGenTL 2. Create a object. This involves the following operations: Euresys::EGenTL locate and dynamically load the Coaxlink GenTL producer ( coaxlink.cti retrieve pointers to the functions exported by , and make them available coaxlink.cti...
Coaxlink Programmer Guide 5. Euresys::EGrabber 5. Euresys::EGrabber is a library of C++ classes that provide a high-level interface. It is built on Euresys::EGrabber top of the library, and is recommended for most users. Euresys::EGenTL A .NET assembly, built on top of the C++ classes, is also provided.
Coaxlink Programmer Guide 5. Euresys::EGrabber 4. Use "GenApi" on page 6 to find out the ID of the Coaxlink card. indicates that we want an answer from the interface module. Euresys::InterfaceModule 5. Similarly, find out the ID of the device. This time, we use...
Page 17
5. Euresys::EGrabber Coaxlink Programmer Guide 3. Start the grabber. Here, we ask the grabber to fill 10 buffers. If we don't want the grabber to stop after a specific number of buffers, we can do grabber.start(GenTL::GENTL_ , or simply INFINITE) grabber.start()
Coaxlink Programmer Guide 5. Euresys::EGrabber We can see that the three buffers that were allocated (let's call them A at 0x7f3c32c54010 , and C at ) are used in a round-robin fashion: A → B → C → 0x7f3c2c4bf010 0x7f3c2c37e010 A →...
Page 19
5. Euresys::EGrabber Coaxlink Programmer Guide 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.
Coaxlink Programmer Guide 5. Euresys::EGrabber The configuration script can easily be shared by several applications written in different programming languages: C++, C#, VB.NET... The full power of Euresys GenApi scripts is available. 5.4. Events Background Coaxlink cards generate different kinds of events:...
5. Euresys::EGrabber Coaxlink Programmer Guide Counters Coaxlink firmware counts each occurrence of each event (except new buffer events) and makes this counter available in a GenApi feature named . Each event has its own counter, EventCount and the value of...
When an event occurs, and event notification is enabled for that event, Euresys::EGrabber executes one of several callback functions. These callback functions are defined in overridden virtual methods: class MyGrabber : public Euresys::EGrabber<> public: private: // callback function for new buffer events virtual void onNewBufferEvent(const NewBufferData&...
5. Euresys::EGrabber Coaxlink Programmer Guide Event identification When an event is notified to the application, the callback function that is executed indicates the category of that event. The actual event that occurred is identified by a numerical ID, called , and defined in numid include/GenTL_v1_5_EuresysCustom.h...
Coaxlink Programmer Guide 5. Euresys::EGrabber Data stream module – Data Stream category Callback function Data type prefix numid onDataStreamEvent DataStreamData EVENT_DATA_NUMID_DATASTREAM_ Device module – CIC category Callback function Data type prefix numid onCicEvent CicData EVENT_DATA_NUMID_CIC_ Interface module – I/O Toolbox category...
Page 25
5. Euresys::EGrabber Coaxlink Programmer Guide The application asks the grabber to create a dedicated thread for each of its callback functions. In each of these threads, the grabber waits for a particular category of events. When an event occurs, the corresponding callback function is executed in that thread.
Coaxlink Programmer Guide 5. Euresys::EGrabber 5.6. Events and callbacks examples On demand callbacks This program displays basic information about CIC events generated by a grabber: #include <iostream> #include <EGrabber.h> using namespace Euresys; // 1 class MyGrabber : public EGrabber<CallbackOnDemand> {...
Page 27
5. Euresys::EGrabber Coaxlink Programmer Guide 6. The callback function receives a . This structure is defined in onCicEvent const CicData & . It contains a few pieces of information about the event that include/EGrabberTypes.h occurred. Here, we display the of each event. The...
Coaxlink Programmer Guide 5. Euresys::EGrabber Single thread and multi thread callbacks This program displays basic information about CIC events generated by a grabber, this time using the model. CallbackSingleThread #include <iostream> #include <EGrabber.h> using namespace Euresys; class MyGrabber : public EGrabber<CallbackSingleThread> {...
This program shows how to access information related to new buffer events. It uses , but it could use another callback method just as well. CallbackMultiThread #include <iostream> #include <EGrabber.h> using namespace Euresys; class MyGrabber : public EGrabber<CallbackMultiThread> { public: MyGrabber(EGenTL &gentl) : EGrabber<CallbackMultiThread>(gentl) { runScript("config.js");...
Coaxlink Programmer Guide 5. Euresys::EGrabber 4. We reach the end of the block where the local variable has been created. It gets out of scope and is destroyed: the destructor is called. This causes the GenTL buffer ScopedBuffer contained in to be re-queued (given back) to the data stream of the grabber.
Coaxlink Programmer Guide 6. Euresys GenApi scripts The Euresys GenApi Script language is documented in a few GenApi scripts. For convenience, they are also included here. 6.1. doc/basics.js // Euresys GenApi Script uses a syntax inspired by JavaScript, but is not // exactly JavaScript.
Page 32
= 1.41421; // x: [3.14159, 2.71828, 1.61803, undefined, 1.41421]; function RegularExpressions() { var x = /CXP[36]_X[124]/; // Like JavaScript, Euresys GenApi Script is a dynamically typed language. The // type of a variable is defined by the value it holds, which can change. function DynamicVariables() { var x = 1;...
Page 33
1 !== 2); // Equality (==) and inequality (!=) JavaScript operators lead to confusing // and inconsistent conversions of their operands. They are not implemented // in Euresys GenApi Script. // Relational operators: < <= > >= assert(1 < 2);...
Page 35
6. Euresys GenApi scripts Coaxlink Programmer Guide for (var i in xs) { sum += xs[i]; assertEqual(1111, sum); var obj = { one: 1, two: 2 }; var sum = 0; for (var p in obj) { sum += obj[p];...
Page 36
Coaxlink Programmer Guide 6. Euresys GenApi scripts finallyDone = false; try { x = 1; if (action === 'fail') { throw action; } else if (action === 'return') { return; x = 2; } catch (e) { // Executed if a throw statement is executed.
Coaxlink Programmer Guide 6.2. doc/builtins.js // This file describes the builtins (functions or objects) of Euresys GenApi // Script. It can be executed by running 'gentl script // coaxlink://doc/builtins.js'. // The builtin object 'console' contains a single function, log, which can be // used to output text to the standard output.
= require(coaxlink://doc/builtins.js); 6.3. doc/grabbers.js // This file describes the 'grabbers' object of Euresys GenApi Script. It can // be executed by running 'gentl script coaxlink://doc/grabbers.js'. // The builtin object 'grabbers' is a list of objects giving access to the // available GenTL modules/ports.
Page 39
6. Euresys GenApi scripts Coaxlink Programmer Guide // Ports also have the following functions to work on GenICam features: get(f) | get value of f set(f,v) | set value v to f execute(f) | execute f features([re]) | get list of features [matching regular expression re]...
"Revision" is ' + revision); 6.4. doc/module1.js // This file describes the special 'module' variable of Euresys GenApi Script. // It can be executed by running 'gentl script coaxlink://doc/module1.js'. It // is also dynamically loaded by the coaxlink://doc/builtins.js script.
Page 41
6. Euresys GenApi scripts Coaxlink Programmer Guide return x + 2; , hello: function() { console.log('Hello from ' + module.filename); console.log('module.exports contains: '); for (var e in module.exports) { console.log('- ' + e + ' (' + typeof module.exports[e] + ')');...
Page 46
Coaxlink Programmer Guide 7. EGrabber for MultiCam users //EGrabber // wait for a buffer Buffer buffer = grabber.pop(timeout); // process buffer // make buffer available for new images buffer.push(grabber); //EGrabber // wait for a buffer ScopedBuffer buffer(grabber, timeout); // process buffer // ScopedBuffer destructor takes care of making buffer available for new images Callbacks //MultiCam...
Coaxlink Programmer Guide 8. .NET assembly 1. Create a object. This involves the following operations: Euresys.EGenTL locate and dynamically load the Coaxlink GenTL producer ( coaxlink.cti retrieve pointers to the functions exported by coaxlink.cti initialize coaxlink.cti 2. Create a object. The constructor needs the Euresys.EGrabberCallbackOnDemand...
This is the C# version of the C++ CallbackSingleThread CallbackSingleThread example: using System; namespace Callbacks { class CallbackExample { static void showEvents(Euresys.EGrabberCallbackSingleThread grabber) { grabber.runScript("config.js"); // 1 grabber.onCicEvent = delegate(Euresys.EGrabberCallbackSingleThread g, // 2 Euresys.CicData data) { System.Console.WriteLine("timestamp: {0} us, {1}", // 3...
Page 52
// 6 while (true) { // 6 static void Main() { try { using (Euresys.EGenTL gentl = new Euresys.EGenTL()) { using (Euresys.EGrabberCallbackSingleThread grabber = new Euresys.EGrabberCallbackSingleThread(gentl)) { showEvents(grabber); } catch (System.Exception e) { System.Console.WriteLine("error: {0}", e.Message); 1. Run a script which should: config.js...
9. Definitions Coaxlink Programmer Guide 9. Definitions Acronyms Camera and Illumination Controller Common Transport Interface CoaXPress EMVA European Machine Vision Association PFNC Pixel Format Naming Convention SFNC Standard Features Naming Convention Glossary Buffer module GenTL module that represents a memory buffer. Buffers must be announced to the data stream that will fill them with image data.
Page 54
Coaxlink Programmer Guide 9. Definitions Camera and illumination controller Part of Coaxlink card that controls a camera and its associated illumination devices. Hosted in the device module. CoaXPress High speed digital interface standard that allows the transmission of data from a device (e.g., a camera) to a host (e.g., a frame grabber inside a computer) over one or several coaxial cables.
Page 55
9. Definitions Coaxlink Programmer Guide Info command Numerical identifier used to query a specific piece of information from a GenTL module. Info commands are defined either in the standard GenTL header file, or in a vendor-specific header file (e.g., info commands specific to Coaxlink are defined in include/GenTL_v1_5_ EuresysCustom.h Interface module...
Need help?
Do you have a question about the Coaxlink Series and is the answer not in the manual?
Questions and answers