Euresys Coaxlink Programmer's Manual

Euresys Coaxlink Programmer's Manual

Hide thumbs Also See for Coaxlink:

Advertisement

PROGRAMMER'S GUIDE
Coaxlink
Coaxlink Driver Version 7.1
EURESYS s.a. 2017 - Document version 7.1.637 built on 2017-04-14
©

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Coaxlink and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Euresys Coaxlink

  • Page 1 PROGRAMMER'S GUIDE Coaxlink Coaxlink Driver Version 7.1 EURESYS s.a. 2017 - Document version 7.1.637 built on 2017-04-14 ©...
  • Page 2 EURESYS s.a. may modify the product specification or change the information given in this documentation at any time, at its discretion, and without prior notice. 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 soware of EURESYS s.a.
  • Page 3: Table Of Contents

    Contents   Coaxlink Programmer's Guide Contents Introduction .................................... GenApi ......................................Register description..................................6 GenApi implementation................................6 Features......................................6 GenTL ......................................System module.................................... 7 Interface module..................................8 Device module..................................... 8 Data stream module..................................8 Buffer module....................................8 GenTL API..................................... 8 Euresys::EGenTL ................................A first example................................... 10 Relevant files....................................11...
  • Page 4 Coaxlink Programmer's Guide   Contents Euresys GenApi scripts ..............................doc/basics.js..................................... 25 doc/builtins.js................................... 30 doc/grabbers.js..................................31 doc/module1.js..................................33 EGrabber for MultiCam users ........................... .NET assembly ..................................A first example................................... 40 Differences between C++ and .NET EGrabber......................... 41 Single thread callbacks................................42 Definitions .....................................
  • Page 5: Introduction

    These libraries are referred to as GenTL producers, or Common Transport Interfaces (CTI) and use the cti file extension. The GenTL producer for Coaxlink cards is coaxlink.cti. This document is meant to be read from beginning to end. Each chapter and section builds upon the preceding ones.
  • Page 6: Genapi

    A GenApi implementation is a soware module that can read and interpret register description files. provides a implementation, but it is fairly difficult to use, and logging is very poor. Instead, we EMVA reference recommend using the Euresys implementation bundled with the Coaxlink soware 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: Gentl

    Figure 1: GenTL Module Hierarchy System module The system module (also referred to as TLSystem), represents the GenTL producer (the coaxlink.cti library). This module is at the top of the parent/child tree. The system module provides basic information about the GenTL producer: things like the complete path to...
  • Page 8: Interface Module

    The GenTL standard calls frame grabbers interfaces. The system module has one child interface for each frame grabber: if there are 2 Coaxlink cards in the computer, the system module will have two child interfaces. Each interface represents a frame grabber. Global frame grabber features such as digital I/O lines belong in the interface module.
  • Page 9 Instead of using the GenTL API directly, we recommend using either: • the Euresys::EGenTL library which deals with these complications so that the user doesn't have to; • or the Euresys::EGrabber library which provides a high-level, easy-to-use interface.
  • Page 10: Euresys::egentl

    GC_API GCGetInfo(TL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize); template<typename T> T gcGetInfo(TL_INFO_CMD cmd); A first example This program uses Euresys::EGenTL to iterate over the Coaxlink cards present in the system, and display their id: #include <iostream> #include <EGrabber.h> // 1...
  • Page 11: Relevant Files

    4. Find out how many cards are present in the system. 5. Retrieve the id of the n-th card. 6. Euresys::EGenTL uses exceptions to report errors, so we wrap our code inside a try ... catch block. Example of program output:...
  • Page 12: Euresys::egrabber

    Euresys::EGrabber Euresys::EGrabber Euresys::EGrabber is a library of C++ classes that provide a high-level interface. It is built on top of the Euresys::EGenTL library, and is recommended for most users. A .NET assembly, built on top of the Euresys::EGrabber C++ classes, is also provided. In this document, we focus mainly on the C++ API.
  • Page 13: Acquiring Images

    • initialize coaxlink.cti (this is done by calling the GenTL initialization function GCInitLib). 3. Create a Euresys::EGrabber object. The constructor needs the gentl object created in step 2. It also takes as optional arguments the indices of the interface and device to use.
  • Page 14 This will be shown in another example. 4. Wait for a buffer filled by the grabber. The result is a Euresys::ScopedBuffer. The term scoped is used to indicate that the lifetime of the buffer is the current scope (i.e., the current block).
  • Page 15: Configuring The Grabber

    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;...
  • Page 16: Events

    The other types of events are restricted to Coaxlink and can be viewed as categories of specific events. For example, in the CIC category of events, we have:...
  • Page 17: Counters

    = 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 function. But first, it is required to...
  • Page 18: Callback Functions

    5. Likewise, enable notifications for all events coming from the device module (CIC events). 6. Finally, enable notifications for all data stream events. Callback functions 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:...
  • Page 19: Event Identification

    Euresys::EGrabber    Coaxlink Programmer's 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 numid, and defined in include/ GenTL_v1_5_EuresysCustom.h:...
  • Page 20: Examples

    Coaxlink Programmer's Guide    Euresys::EGrabber Interface module – I/O Toolbox category numid prefix Callback function Data type onIoToolboxEvent IoToolboxData EVENT_DATA_NUMID_IO_TOOLBOX_ Interface module – CXP Interface category numid prefix Callback function Data type onCxpInterfaceEvent CxpInterfaceData EVENT_DATA_NUMID_CXP_INTERFACE_ Examples We'll soon show a few complete...
  • Page 21: Events And Callbacks Examples

    To give the user maximum flexibility, we support all three callback models. This is why Euresys::EGrabber exists in different flavors. So far, we have eluded the meaning of the angle brackets in EGrabber<>. The EGrabber class is actually a template class, i.e., a class that is parameterized by another type:...
  • Page 22: Single Thread And Multi Thread Callbacks

    "error: " << e.what() << std::endl; 1. This using directive allows writing Xyz instead of Euresys::Xyz. This helps keep lines relatively short. 2. Define a new class MyGrabber which is derived from EGrabber<CallbackOnDemand>. 3. MyGrabber's constructor initializes its base class by calling EGrabber<CallbackOnDemand>'s constructor.
  • Page 23: New Buffer Callbacks

    Euresys::EGrabber    Coaxlink Programmer's Guide runScript("config.js"); enableEvent<CicData>(); reallocBuffers(3); start(); private: virtual void onCicEvent(const CicData &data) { std::cout << "timestamp: " << std::dec << data.timestamp << " us, " << "numid: 0x" << std::hex << data.numid << " (" << getEventDescription(data.numid) <<...
  • Page 24: Relevant Files

    Main header. Includes other headers except Defines Euresys::EGrabber, Euresys::Buffer, Euresys::ScopedBuffer include/EGrabberTypes.h Defines data types related to Euresys::EGrabber include/EGenTL.h Defines Euresys::EGenTL include/GenTL_v1_5.h Standard GenTL header. Defines standard types, functions and constants include/GenTL_v1_5_EuresysCustom.h Defines Coaxlink-specific constants include/RGBConverter.h Defines Euresys::RGBConverter helper class...
  • Page 25: Euresys Genapi Scripts

    Euresys GenApi scripts   Coaxlink Programmer's Guide Euresys GenApi scripts The Euresys GenApi Script language is documented in a few GenApi scripts. For convenience, they are also included here. doc/basics.js // Euresys GenApi Script uses a syntax inspired by JavaScript, but is not // exactly JavaScript.
  • Page 26 // x: [3.14159, 2.71828, 1.61803, undefined, 1.41421]; function RegularExpressions() { 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() { x = 1;...
  • Page 27 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 28 = { one: 1, two: 2 }; sum = 0; for (var obj) { sum += obj[p]; assertEqual(3, sum); str = "Coaxlink"; sum = ""; for (var str) { sum += str[i]; assertEqual("Coaxlink", sum); // for..of loops: iterating over values...
  • Page 29 Euresys GenApi scripts   Coaxlink Programmer's Guide function ContinueAndBreak() { sum = 0; (i = 0; i < 100; ++i) { (i === 3) { continue; else if (i === 6) { break; else sum += i; assertEqual(0 + 1 + 2 + 4 + 5, sum);...
  • Page 30: Doc/Builtins.js

    'failed assertion'; 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.
  • Page 31: Doc/Grabbers.js

    // - absolute paths var mod = require('C:\\absolute\\path\\some-module.js'); // - relative paths (paths relative to the current script) var mod = require('./utils/helper.js'); // - coaxlink:// paths (paths relative to the directory where coaxlink scripts are installed) var mod = require(coaxlink://doc/builtins.js); doc/grabbers.js // This file describes the 'grabbers' object of Euresys GenApi Script.
  • Page 32 Coaxlink Programmer's Guide   Euresys GenApi scripts // 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]...
  • Page 33: Doc/Module1.Js

    "Revision" is ' + revision); 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 34: Egrabber For Multicam Users

    Coaxlink Programmer's Guide   EGrabber for MultiCam users EGrabber for MultiCam users Concepts EGrabber MultiCam Board Interface Channel Device + Data stream Surface Buffer Surface cluster (MC_Cluster) Buffers announced to the data stream Remote device (camera) MultiCam parameters GenApi set/get features GenApi...
  • Page 35 EGrabber for MultiCam users   Coaxlink Programmer's Guide Euresys::EGrabber<> grabber(gentl, CARD_INDEX, DEVICE_INDEX); Surface creation (automatic) //MultiCam status = McSetParamInt(channel, MC_SurfaceCount, BUFFER_COUNT); (status != MC_OK) { //EGrabber grabber.reallocBuffers(BUFFER_COUNT); Surface creation (manual) //MultiCam (size_t i = 0; i < BUFFER_COUNT; ++i) { MCHANDLE surface;...
  • Page 36 (either SystemModule, InterfaceModule, DeviceModule, or StreamModule). Camera configuration EGrabber MultiCam grabber.runScript(filepath) grabber.runScript(script) grabber.setInteger<RemoteModule>(name, value), grabber.setFloat<RemoteModule>(name, value), or grabber.setString<RemoteModule>(name, value) Script files //MultiCam ; CAM file ChannelParam1 = Value1; ChannelParam2 = Value2; //EGrabber // Euresys GenApi Script grabber = grabbers[0]; grabber.DevicePort.set('DeviceFeature1', Value1); grabber.DevicePort.set('DeviceFeature2', Value2); grabber.RemotePort.set('CameraFeatureA', ValueA);...
  • Page 37 EGrabber for MultiCam users   Coaxlink Programmer's Guide Acquisition start/stop //MultiCam // start "live" McSetParamInt(channel, MC_GrabCount, MC_INFINITE); McSetParamInt(channel, MC_ChannelState, MC_ChannelState_ACTIVE); // stop McSetParamInt(channel, MC_ChannelState, MC_ChannelState_IDLE); // grab 10 images McSetParamInt(channel, MC_GrabCount, 10); McSetParamInt(channel, MC_ChannelState, MC_ChannelState_ACTIVE); //EGrabber // start "live" grabber.start(); // stop grabber.stop();...
  • Page 38 Coaxlink Programmer's Guide   EGrabber for MultiCam users MC_SignalEnable_ON); (status != MC_OK) { // enable "END_EXPOSURE" events status = McSetParamInt(channel, MC_SignalEnable + MC_SIG_END_EXPOSURE, MC_SignalEnable_ON); (status != MC_OK) { // register "extern C" callback function MCSTATUS status = McRegisterCallback(channel, GlobalCallbackFunction, this); (status != MC_OK) {...
  • Page 39 EGrabber for MultiCam users   Coaxlink Programmer's Guide MyChannel() { // create and configure channel // enable "END_EXPOSURE" events status = McSetParamInt(channel, MC_SignalEnable + MC_SIG_END_EXPOSURE, MC_SignalEnable_ON); (status != MC_OK) { void waitForEvent(uint32_t timeout) { // wait for an event MCSTATUS status = McWaitSignal(channel, MC_SIG_END_EXPOSURE, timeout, &info);...
  • Page 40: Net Assembly

    2. Create a Euresys.EGrabberCallbackOnDemand object. The constructor needs the gentl object we've just created. It also takes as optional arguments the indices of the interface and device to use. on page 6 to find out the ID of the Coaxlink card. Notice the InterfaceModule suffix in getString 3. Use GenApi InterfaceModule .
  • Page 41: Differences Between C++ And .Net Egrabber

    .NET assembly   Coaxlink Programmer's Guide Example of program output: Interface: PC1633 - Coaxlink Quad G3 (2-camera) - KQG00014 Device: Device0 Resolution: 4096x4096 Differences between C++ and .NET EGrabber Terms in ITALIC are placeholders: • MODULE can be replaced by InterfaceModule, DeviceModule...
  • Page 42: Single Thread Callbacks

    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 data.timestamp, data.numid); // 4 grabber.enableCicDataEvent(); // 5 grabber.reallocBuffers(3);...
  • Page 43 .NET assembly   Coaxlink Programmer's Guide timestamp: 2790824902 us, EVENT_DATA_NUMID_CIC_CXP_TRIGGER_ACK timestamp: 2790825897 us, EVENT_DATA_NUMID_CIC_STROBE_FALLING_EDGE timestamp: 2790830397 us, EVENT_DATA_NUMID_CIC_CAMERA_TRIGGER_FALLING_EDGE timestamp: 2790830401 us, EVENT_DATA_NUMID_CIC_CXP_TRIGGER_ACK timestamp: 2790842190 us, EVENT_DATA_NUMID_CIC_ALLOW_NEXT_CYCLE timestamp: 2790842190 us, EVENT_DATA_NUMID_CIC_CAMERA_TRIGGER_RISING_EDGE timestamp: 2790842191 us, EVENT_DATA_NUMID_CIC_STROBE_RISING_EDGE timestamp: 2790842195 us, EVENT_DATA_NUMID_CIC_CXP_TRIGGER_ACK...
  • Page 44: Definitions

    Defines when and where (in which thread) callback functions are executed. One of CallbackOnDemand, CallbackSingleThread, CallbackMultiThread. 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 that allows the transmission of data from a device (e.g., a camera) to a host...
  • Page 45 GenTL module that represents a frame grabber. Parent of the device module. I/O toolbox Part of Coaxlink card that controls digital I/O lines and implements tools such as rate converters, delay lines, etc. Hosted in the interface module. Register description XML file mapping low-level hardware registers to camera or frame grabber features.

Table of Contents