Skip to content
⚡ Developer documentation for INFINICAM, the real-time high-speed camera (UC-1.1 / GbE-2)

Creating the HelloWorld Project

In this guide, you will create a new C++ console application in Visual Studio, configure the paths for the INFINICAM SDK (PUCLIB) distributed as a ZIP file, and build a basic program that retrieves information from a GbE-2 (Ethernet model).

  1. Create a new Visual Studio project

    1. Launch Visual Studio and select “Create a new project”.
    2. From the template list, select “Console App” (C++ / Windows / Console) and click “Next”.
    3. Enter a project name (e.g. GbE2_HelloWorld) and click “Create”.
  2. Change the build configuration to x64

    Change the platform setting in the toolbar at the top of the screen from x86 to x64.

  3. Set the include path (C/C++)

    Add the path needed to load the header files (.h) from the extracted SDK.

    1. In Solution Explorer on the right side of the screen, right-click the project name and select “Properties”.
    2. Set the configuration to “All Configurations” and the platform to “x64”.
    3. From the tree on the left, select “C/C++” > “General”.
    4. In “Additional Include Directories” on the right, add the path to the extracted include folder.
      C:\infinicam_sdk\include
  4. Set the library path (Linker)

    Configure the settings needed to load the SDK’s library file (.lib).

    1. From the tree on the left of the properties screen, select “Linker” > “General”.
    2. In “Additional Library Directories”, add the path to the extracted lib\x64 folder.
      C:\infinicam_sdk\lib\x64
    3. Next, select “Linker” > “Input” from the tree on the left.
    4. Add puclib.lib; to the beginning of “Additional Dependencies”.
    5. Click “Apply” > “OK” to close the properties screen.
  5. Write the source code

    Open the main file (e.g. GbE2_HelloWorld.cpp) and replace its contents with the following code.

    #include <stdio.h>
    #include <stdlib.h>
    #include <PUCLIB.h> // Load the PUCLIB header
    int main() {
    printf("Initializing INFINICAM GbE-2...\n");
    // 1. Initialize the SDK
    PUCRESULT ret = PUC_Initialize();
    if (ret != PUC_SUCCEEDED) {
    printf("Error: Failed to initialize the SDK. ErrorCode: %d\n", ret);
    return EXIT_FAILURE;
    }
    // 2. Search for a GbE-2 device on the network
    PUC_DETECT_FILTER filter = { 0 };
    filter.nDeviceTypeFlags = PUC_DETECT_TARGET_GBE2; // Target GbE-2 devices
    PUC_DETECT_INFO detectInfo = { 0 };
    ret = PUC_DetectDevice2(&filter, &detectInfo);
    if (ret != PUC_SUCCEEDED || detectInfo.nDeviceCount == 0) {
    printf("Error: No GbE-2 camera was found. ErrorCode: %d\n", ret);
    return EXIT_FAILURE;
    }
    printf("Detected a GbE-2 camera. (Devices found: %d)\n", detectInfo.nDeviceCount);
    // 3. Open the first detected device
    PUC_HANDLE hDevice = NULL;
    ret = PUC_OpenDevice2(0, &hDevice);
    if (ret != PUC_SUCCEEDED) {
    printf("Error: Failed to open the device. ErrorCode: %d\n", ret);
    return EXIT_FAILURE;
    }
    printf("SUCCESS: The GbE-2 was opened successfully!\n");
    // 4. Example of retrieving camera information
    UINT64 serialNo = 0;
    if (PUC_GetSerialNo(hDevice, &serialNo) == PUC_SUCCEEDED) {
    printf("Serial number: %llu\n", serialNo);
    }
    UINT32 version = 0;
    if (PUC_GetDeviceVersion(hDevice, &version) == PUC_SUCCEEDED) {
    printf("Device version: %u\n", version);
    }
    // 5. Close the device
    PUC_CloseDevice(hDevice);
    return EXIT_SUCCESS;
    }
  6. Deploy the runtime DLL and run the program

    1. Press Ctrl + Shift + B to build the project.
    2. Copy puclib.dll (and its associated DLLs) from the bin\x64\ folder of the extracted SDK into the same folder as the .exe generated by the build (x64/Debug or x64/Release).
    3. Connect the PC and the GbE-2 with an Ethernet cable, match the network settings (IP address, etc.), and press Ctrl + F5 (Start Without Debugging) to run the program. If the serial number is displayed in the console window, it has succeeded!