eSDK Code Examples

The eSDK installation includes C++ example code in the <install_path>\EVT\eSDK\Examples directory. These examples demonstrate all the camera's functions and are a valuable resource for software developers.

On Windows, the examples are pre-configured projects that can be opened, compiled, and run using Microsoft Visual Studio Express 2019 or later. On Linux, they consist of source files and makefiles that you can build with g++.

The EVT_BenchmarkHS example is the recommended starting point for application development and for benchmarking your camera at its maximum resolution and frame rate.

Note: The following procedures use the EVT_BenchmarkHS example but you can easily modify them for the other examples.

Building code examples

You can build the code examples on Windows or Linux.

Note: For simplicity when getting started, the following procedures assume you are building and running the code examples on the computer/server that you will connect the camera to.

Prerequisites:

  • On Windows, install Microsoft Visual Studio Express 2019 or later.
  • On Linux, install g++ tools. To install them on Ubuntu 20.04 LTS or later, run the following command:
    sudo apt-get install build-essential

On Windows:

  1. Open Visual Studio.
  2. Navigate to <install_path>\EVT\eSDK\Examples\EVT_BenchmarkHS\.
  3. Open the solution file EVT_BenchmarkHS.sln.
  4. If prompted, upgrade the project to the latest version of the Windows SDK and Platform Toolset.
  5. Click Build to compile the project. The build should complete with 0 Errors.

On Linux:

  1. Open a terminal.
  2. Navigate to /opt/EVT/eSDK/Examples/EVT_BenchmarkHS/.
  3. Compile the project by running make. The build should complete with 0 Errors.

Running code examples

After you build the code examples, you can run them on Windows or Linux.

Prerequisites:

  • Connect an Emergent camera to the computer or server.
  • Connect power to the camera.
  • To ensure the camera's IP address is in the same subnet as the NIC's IP address, perform the procedures in Basic eCapture Pro Usage , which includes steps to "automatically configure the IP addresses, subnet masks, and maximum transmission unit (MTU) of the camera and NIC".

On Windows:

  1. Open a command prompt.
  2. Navigate to <install_path>\EVT\eSDK\Examples\EVT_BenchmarkHS\x64\Debug\.
  3. Run the program by typing EVT_BenchmarkHS and pressing Enter.
    The program should show information like the following text:

-------------------------------
BenchmarkHS : Example program
-------------------------------
Open Camera:            Camera Opened

----- INT_TRIGGER Mode -----
..........

Images Captured:        1000
Dropped Frames:         0
Frame Rate Setting:     105
Calculated Frame Rate:  104.975856

Close Camera:           Camera Closed

On Linux:

  1. Open a terminal.
  2. Navigate to /opt/EVT/eSDK/Examples/EVT_BenchmarkHS/out/.
  3. Run the program by typing the following command and pressing Enter:
    sudo ./EVT_BenchmarkHS
    The program should show information like the text above.
Updated on
November 19, 2024
Questions?


Get in touch with us today and our team of imaging professionals will be pleased to assist you.

Contact Us