Documentation Portal      

What are you looking for?

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 <EGenTL.h>                                             // 1

void listCards() {
    Euresys::EGenTL gentl;                                      // 2
    GenTL::TL_HANDLE tl = gentl.tlOpen();                       // 3
    uint32_t numCards = gentl.tlGetNumInterfaces(tl);           // 4
    for (uint32_t n = 0; n < numCards; ++n) {
        std::string id = gentl.tlGetInterfaceID(tl, n);         // 5
        std::cout << "[" << n << "] " << id << std::endl;
    }
}

int main() {
    try {                                                       // 6
        listCards();
    } catch (const std::exception &e) {                         // 6
        std::cout << "error: " << e.what() << std::endl;
    }
}
1. Include EGenTL.h, which contains the definition of the Euresys::EGenTL class.
2. Create a Euresys::EGenTL object. This involves the following operations:
locate and dynamically load the Coaxlink GenTL producer (coaxlink.cti);
retrieve pointers to the functions exported by coaxlink.cti, and make them available via Euresys::EGenTL methods;
initialize coaxlink.cti (this is done by calling the GenTL initialization function GCInitLib).
3. Open the GenTL producer. This returns a handle of type GenTL::TL_HANDLE. The GenTL namespace is defined in the standard GenTL header file, which has been automatically included by EGenTL.h in step 1.
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

[0] PC1633 - Coaxlink Quad G3 (1-camera, line-scan) - KQG00014
[1] PC1632 - Coaxlink Quad (1-camera) - KQU00031

© 2018EURESYS s.a.  -  About Documentation  -  Coaxlink 10.3.1.2052