Home > C: Programming > Function Descriptions > History back  Previous chapter  Next chapter  Print  

is_InitCamera

uEye Camera Manual Version 3.80

is_InitCamera

Windows_Logo

Linux_Logo

USB 2.0

GigE

USB 2.0

GigE

Syntax

INT is_InitCamera (HIDS* phf, 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 for image display, you can pass a handle to the output window.

Achtung

GigE uEye SE only

When you are using a GigE uEye SE camera, 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 GigE uEye SE 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.

If you have initialized the camera with a driver version earlier than 3.40, you need to update the camera firmware manually using the uEye Camera Manager. Driver versions 3.40 and higher support automatic firmware updates.

Hinweis

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 phf handle must previously have been set to the desired camera ID.

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

Hinweis

Thread safety

We recommend that you call the following functions exclusively from a single thread in order to avoid unpredictable behavior of the application.

See also General: Thread Programming.

Input Parameters

phf

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 (only GigE uEye SE cameras).

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 Code Sample 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_SUCCESS

Function executed successfully

IS_NO_SUCCESS

General error message

IS_STARTER_FW_UPLOAD_NEEDED

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

Related Functions

is_ExitCamera()
is_EnableAutoExit()
is_GetCameraList()
is_SetCameraID()
is_GetCameraInfo()
is_GetDuration() (when a GigE uEye SE camera is used)
is_SetStarterFirmware() (when a GigE uEye SE camera is used)

Code Sample


//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

nRet = is_InitCamera (&hCam | IS_ALLOW_STARTER_FW_UPLOAD, NULL);

 

/*

... end progress bar

*/

}

}

Sample Programs

uEyeMultipleCameraScan (C++)
uEyeConsole (C++)
uEyeC# Demo (C#)

Suggestion for improvement? Send us your short Feedback on this chapter. Thank you very much!


© 2010 IDS Imaging Development Systems GmbH
http://www.ids-imaging.com