Please enable JavaScript to view this site.

IDS Software Suite 4.96.1

Windows_Logo
Linux_Logo

USB 2.0

USB 3.x

GigE

USB 2.0

USB 3.x

GigE

Syntax

INT is_InitCamera (HIDS* phCam, HWND hWnd)

Description

is_InitCamera() starts the driver and establishes the connection to the camera. After successful initialization, this function assigns the camera handle. All subsequent functions require this handle as the first parameter.

When using Direct3D or OpenGL for image display, you can pass a handle to the output window.

hint_info

Starter firmware for GigE uEye cameras

When you are using these camera models, initialization will be aborted with an error message if the camera's starter firmware is not compatible with the installed driver. To initialize the camera, you have to write the proper starter firmware to the camera first. This is done using the is_InitCamera() function with corresponding parameter setting (see Input parameters table).

Updating the firmware can take up to 20 seconds. It is important not to disconnect the camera from the PC or power supply during this time. Otherwise, malfunctions could occur in the camera.

Camera models GigE uEye SE/RE only: f you have initialized the camera with a driver version earlier than 3.40, you need to update the camera firmware manually using the IDS Camera Manager. Driver versions 3.40 and higher support automatic firmware updates.

hint_info

Note on multi-camera environments

When using multiple cameras in parallel operation on a single system, you should assign a unique camera ID to each camera. To initialize or select a camera with is_InitCamera(), the phCam handle must previously have been set to the desired camera ID.

To initialize or select the next available camera without specifying a camera ID, phCam has to be preset with 0.

Input parameters

phCam

Pointer to the camera handle

When you call this function, the pointer value has the following meaning:

0: The first available camera will be initialized or selected.

1-254: The camera with the specified camera ID will be initialized or selected.

*phCam |
IS_USE_DEVICE_ID

The camera is opened using the device ID instead of the camera ID. For details on device ID please refer to the is_GetCameraList() chapter.

*phCam |
IS_ALLOW_STARTER_FW_UPLOAD

During initialization of the camera, this parameter checks whether a new version of the starter firmware is required. If it is, the new starter firmware is updated automatically.

To ensure backward compatibility of applications, always call is_InitCamera() without the IS_ALLOW_STARTER_FW_UPLOAD parameter first. Only if an error occurs, call the function with this parameter set (see Example below).

hWnd

Pointer to the window where the Direct3D image will be displayed

If hWnd = NULL, DIB mode will be used for image display.

Return values

IS_ALL_DEVICES_BUSY

All cameras are in use

IS_BAD_STRUCTURE_SIZE

An internal structure has an incorrect size.

IS_CANT_ADD_TO_SEQUENCE

The image memory is already included in the sequence and cannot be added again.

IS_CANT_COMMUNICATE_WITH_DRIVER

Communication with the driver failed because no driver has been loaded.

IS_CANT_OPEN_DEVICE

An attempt to initialize or select the camera failed (no camera connected or initialization error).

IS_CANT_OPEN_REGISTRY

Error opening a Windows registry key

IS_CANT_READ_REGISTRY

Error reading settings from the Windows registry

IS_CAPTURE_RUNNING

A capturing operation is in progress and must be terminated first.

IS_CRC_ERROR

A CRC error-correction problem occurred while reading the settings.

IS_DEVICE_ALREADY_PAIRED

The device is already in use by the system or is being used by another system. (Camera was opened and paired to a device).

IS_DEVICE_NOT_COMPATIBLE

The device is not compatible to the drivers.

IS_DR_CANNOT_CREATE_SURFACE

The image surface or overlay surface could not be created.

IS_DR_CANNOT_CREATE_TEXTURE

The texture could not be created.

IS_DR_CANNOT_CREATE_VERTEX_BUFFER

The vertex buffer could not be created.

IS_DR_DEVICE_OUT_OF_MEMORY

Not enough graphics memory available.

IS_DR_LIBRARY_NOT_FOUND

The DirectRenderer library could not be found.

IS_ERROR_CPU_IDLE_STATES_CONFIGURATION

The configuration of the CPU idle has failed.

IS_FILE_WRITE_OPEN_ERROR

File cannot be opened for writing or reading.

IS_INCOMPATIBLE_SETTING

Because of other incompatible settings the function is not possible.

IS_INVALID_BUFFER_SIZE

The image memory has an inappropriate size to store the image in the desired format.

IS_INVALID_CAMERA_TYPE

The camera type defined in the .ini file does not match the current camera model.

IS_INVALID_CAPTURE_MODE

The function can not be executed in the current camera operating mode (free run, trigger or standby).

IS_INVALID_DEVICE_ID

The device ID is invalid. Valid IDs start from 1 for USB cameras, and from 1001 for GigE cameras.

IS_INVALID_EXPOSURE_TIME

This setting is not available for the currently set exposure time.

IS_INVALID_CAMERA_HANDLE

Invalid camera handle

IS_INVALID_IP_CONFIGURATION

The configuration of the IP address is invalid.

IS_INVALID_MEMORY_POINTER

Invalid pointer or invalid memory ID

IS_INVALID_MODE

Camera is in standby mode, function not allowed

IS_INVALID_PARAMETER

One of the submitted parameters is outside the valid range or is not supported for this sensor or is not available in this mode.

IS_INVALID_PIXEL_CLOCK

This setting is not available for the currently set pixel clock frequency.

IS_IO_REQUEST_FAILED

An IO request from the uEye driver failed. Possibly the versions of the ueye_api.dll (API) and the driver file (ueye_usb.sys or ueye_eth.sys) do not match.

IS_NETWORK_CONFIGURATION_INVALID

The configuration of the network card is invalid.

IS_NETWORK_FRAME_SIZE_INCOMPATIBLE

The settings for the image size of the camera are not compatible to the PC network card.

IS_NO_ACTIVE_IMG_MEM

No active image memory available. You must set the memory to active using the is_SetImageMem() function or create a sequence using the is_AddToSequence() function.

IS_NO_IMAGE_MEM_ALLOCATED

The driver could not allocate memory.

IS_NO_IR_FILTER

No IR filter available

IS_NO_SUCCESS

General error message

IS_NOT_CALIBRATED

The camera does not contain any calibration data.

IS_NOT_SUPPORTED

The camera model used here does not support this function or setting.

IS_NULL_POINTER

Invalid array

IS_OUT_OF_MEMORY

No memory could be allocated.

IS_SEQUENCE_BUF_ALREADY_LOCKED

The memory could not be locked. The pointer to the buffer is invalid.

IS_STARTER_FW_UPLOAD_NEEDED

The camera's starter firmware is not compatible with the driver and needs to be updated.

IS_SUCCESS

Function executed successfully

IS_SUBNET_MISMATCH

The subnet of the camera and PC network card are different.

IS_SUBNETMASK_MISMATCH

The subnet mask of the camera and PC network card are different.

IS_TIMED_OUT

A timeout occurred. An image capturing process could not be terminated within the allowable period.

IS_TRIGGER_ACTIVATED

The function cannot be used because the camera is waiting for a trigger signal.

Related functions

is_ExitCamera()

is_EnableAutoExit()

is_GetCameraList()

is_SetCameraID()

is_GetCameraInfo()

is_GetDuration()

Example

//Open camera with ID 1
HIDS hCam = 1;
INT nRet = is_InitCamera (&hCam, NULL);
 
if (nRet != IS_SUCCESS)
{
//Check if GigE uEye SE needs a new starter firmware
if (nRet == IS_STARTER_FW_UPLOAD_NEEDED)
{
  //Calculate time needed for updating the starter firmware
  INT nTime;
  is_GetDuration (hCam, IS_SE_STARTER_FW_UPLOAD, &nTime);
  /*
   e.g. have progress bar displayed in separate thread
  */
 
  //Upload new starter firmware during initialization
  hCam = hCam | IS_ALLOW_STARTER_FW_UPLOAD;
  nRet = is_InitCamera (&hCam, NULL);
 
  /*
    end progress bar
   */
}
}

Sample programs

uEyeMultipleCameraScan (C++)

uEyeConsole (C++)

uEyeC# Demo (C#)

© 2022 IDS Imaging Development Systems GmbH