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

is_Exposure

uEye Camera Manual Version 4.00

is_Exposure

Windows_Logo

Linux_Logo

USB 2.0

USB 3.0

GigE

USB 2.0

USB 3.0

GigE

Syntax

INT is_Exposure (HIDS hCam, UINT nCommand, void* pParam, UINT cbSizeOfParam)

Description

Using is_Exposure() you can query the exposure time ranges available in your camera, and set new exposure times.

The nCommand input parameter is used to select the function mode. The pParam input parameter depends on the selected function mode. If you select functions for setting or returning a value, pParam contains a pointer to a variable of the UINT type. The size of the memory area to which pParam refers is specified in the cbSizeOfParam input parameter.

Achtung

Note on dependencies on other settings

The use of the following functions will affect the exposure time:

is_PixelClock()

is_SetOptimalCameraTiming()

is_SetFrameRate()

is_AOI() (if the image size is changed)

is_SetSubSampling()

is_SetBinning()

Changes made to the image size, the frame rate or the pixel clock frequency also affect the exposure time. For this reason, you need to call is_Exposure() again after such changes.

Hinweis

Note on new driver versions

Newer driver versions sometimes allow an extended value range for the exposure time setting. We recommend querying the value range every time and set the exposure time explicitly.

Applying new settings

In freerun mode (is_CaptureVideo()), any modification of the exposure time will only become effective when the next image but one is captured. In trigger mode (is_SetExternalTrigger()), the modification will be applied to the next image. See also the Applying new parameters chapter.

Accuracy of the exposure time setting

The increments for setting the exposure time (IS_GET_EXPOSURE_INCREMENT) depend on the sensor's current timing settings (pixel clock, frame rate). The smallest increment usually corresponds to the duration of one pixel row, which is the time it takes the sensor to read out one pixel row.

You can query the actual exposure time setting with the IS_EXPOSURE_CMD_GET_EXPOSURE parameter.

Some sensors allow setting the exposure time in smaller increments. Using the IS_EXPOSURE_CMD_GET_CAPS parameter, you can check whether your sensor supports this function.

For minimum and maximum exposure times as well as other sensor-based dependencies, please refer to the Camera and sensor data chapter.

Rounding errors from increments

When calculating a new exposure time based on the returned increment, note that calculations with floating point values in the PC will always be subject to rounding errors. Therefore, an addition or subtraction of the n*INCREMENT value might not always produce the exact desired result. In this case, the uEye API rounds down the floating point value and sets the exposure time to the next lower value.

You can avoid this behavior by additionally adding the value INCREMENT/2.f (half increment) when calculating with n*INCREMENT. This ensures that the desired value will be set even after rounding.

Hinweis

Note on older uEye exposure time functions

The following uEye API commands are obsolete by the is_Exposure() function:

is_GetExposureRange()

is_SetExposureTime()

See also Obsolete functions

Input parameters

hCam

Camera handle

IS_EXPOSURE_CMD_GET_CAPS

Returns the supported function modes.

pParam: Pointer to bit mask of type UINT
In the bit mask, the status flags from EXPOSURE_CAPS are returned.

nSizeOfParam: 4

Example 1

IS_EXPOSURE_CMD_GET_EXPOSURE_DEFAULT

Returns the default setting for the exposure time.

pParam: Pointer to variable of type double returning the default value.

nSizeOfParam: 8

IS_EXPOSURE_CMD_GET_EXPOSURE

Returns the currently set exposure time (in ms).

pParam: Pointer to variable of type double returning the current value.

nSizeOfParam: 8

IS_EXPOSURE_CMD_GET_EXPOSURE_RANGE_MIN

Returns the minimum exposure time.

pParam: Pointer to variable of type double returning the minimum value.

nSizeOfParam: 8

IS_EXPOSURE_CMD_GET_EXPOSURE_RANGE_MAX

Returns the maximum exposure time.

pParam: Pointer to variable of type double returning the maximum value.

nSizeOfParam: 8

IS_EXPOSURE_CMD_GET_EXPOSURE_RANGE_INC

Returns the exposure time increment.

pParam: Pointer to variable of type double returning the increment.

nSizeOfParam: 8

IS_EXPOSURE_CMD_GET_EXPOSURE_RANGE

Returns the exposure time range.

pParam: Pointer to array of type double returning the minimum and maximum values and the increment (in exactly this order).

nSizeOfParam: 24

IS_EXPOSURE_CMD_GET_FINE_INCREMENT_RANGE_MIN

Returns the minimum exposure time in fine increments for some sensors.

pParam: Pointer to variable of type double returning the minimum value.

nSizeOfParam: 8

Example 2

IS_EXPOSURE_CMD_GET_FINE_INCREMENT_RANGE_MAX

Returns the maximum exposure time in fine increments for some sensors.

pParam: Pointer to variable of type double returning the maximum value.

nSizeOfParam: 8

IS_EXPOSURE_CMD_GET_FINE_INCREMENT_RANGE_INC

Returns the exposure time increment in fine increments for some sensors.

pParam: Pointer to variable of type double returning the increment.

nSizeOfParam: 8

IS_EXPOSURE_CMD_GET_FINE_INCREMENT_RANGE

Returns the exposure time range in fine increments for some sensors.

pParam: Pointer to array of type double returning the minimum and maximum values and the increment (in exactly this order).

nSizeOfParam: 24

Example 3

IS_EXPOSURE_CMD_SET_EXPOSURE

Sets the exposure time (in ms).

pParam: Pointer to variable of type double that passes the value to be set.

nSizeOfParam: 8

If 0 is passed, the exposure time is set to the maximum value of 1/frame rate.

IS_EXPOSURE_CMD_GET_LONG_EXPOSURE_RANGE_MIN

Returns the minimum long exposure time.

pParam: Pointer to variable of type double returning the minimum value.

nSizeOfParam: 8

IS_EXPOSURE_CMD_GET_LONG_EXPOSURE_RANGE_MAX

Returns the maximum long exposure time.

pParam: Pointer to variable of type double returning the maximum value.

nSizeOfParam: 8

IS_EXPOSURE_CMD_GET_LONG_EXPOSURE_RANGE_INC

Returns the increments for long exposure.

pParam: Pointer to variable of the type double returning the increment.

nSizeOfParam: 8

IS_EXPOSURE_CMD_GET_LONG_EXPOSURE_RANGE

Returns the value range for long exposure.

pParam: Pointer to an array of the type double returning the minmum and maximum values and the increment.

nSizeOfParam: 24

IS_EXPOSURE_CMD_GET_LONG_EXPOSURE_ENABLE

Returns the current settings for long exposure.

pval1: returns the current setting

IS_EXPOSURE_CMD_SET_LONG_EXPOSURE_ENABLE

Enables/Disables long exposure.

pval1 = 1 enables control, 0 disables control

pParam

Pointer to a function parameter, whose function depends on nCommand.

cbSizeOfParam

Size (in bytes) of the memory area to which pParam refers.

Contents of the EXPOSURE_CAPS structure

INT

IS_EXPOSURE_CAP_EXPOSURE

The exposure time setting is supported

INT

IS_EXPOSURE_CAP_FINE_INCREMENT

Fine exposure time increments are supported

INT

IS_EXPOSURE_CAP_LONG_EXPOSURE

Long time exposure is supported

Return values

IS_CANT_OPEN_DEVICE

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

IS_CANT_COMMUNICATE_WITH_DRIVER

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

IS_INVALID_CAMERA_TYPE

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

IS_INVALID_CAMERA_HANDLE

Invalid camera handle

IS_INVALID_MODE

Camera is in standby mode, function not allowed

UI-146x/UI-546x models: Function not allowed because the camera is in freerun synchronization mode.

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_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_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_SUCCESS

Function executed successfully

IS_TIMED_OUT

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

Related functions

is_SetFrameRate()

is_PixelClock()

is_SetOptimalCameraTiming()

is_SetAutoParameter()

is_AutoParameter()

is_SetHardwareGain()

Example 1

UINT nCaps = 0;

INT nRet = is_Exposure(m_hCam, IS_EXPOSURE_CMD_GET_CAPS, (void*)&nCaps, sizeof(nCaps));

 

if (nRet == IS_SUCCESS)

{

  if (nCaps & IS_EXPOSURE_CAP_FINE_INCREMENT)

  {

      // Fine increment supported

  }

}

Example 2

double dblMin, dblMax, dblInc;

 

INT nRet = is_Exposure(m_hCam,

            IS_EXPOSURE_CMD_GET_FINE_INCREMENT_RANGE_MIN,

            (void*)&dblMin,

            sizeof(dblMin)

          );

 

INT nRet = is_Exposure(m_hCam,

            IS_EXPOSURE_CMD_GET_FINE_INCREMENT_RANGE_MAX,

            (void*)&dblMax,

            sizeof(dblMax)

          );

 

 

INT nRet = is_Exposure(m_hCam,

            IS_EXPOSURE_CMD_GET_FINE_INCREMENT_RANGE_INC,

            (void*)&dblInc,

            sizeof(dblInc)

          );

Example 3

double dblRange[3];

double dblMin, dblMax, dblInc;

 

INT nRet = is_Exposure(m_hCam,

            IS_EXPOSURE_CMD_GET_FINE_INCREMENT_RANGE,

            (void*)dblRange,

            sizeof(dblRange)

          );

 

if (nRet == IS_SUCCESS)

{

  dblMin = dblRange[0];

  dblMax = dblRange[1];

  dblInc = dblRange[2];

}


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

For technical questions please contact you local distributor or use the support form on our website.


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