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

is_IO

uEye Camera Manual Version 4.00

is_IO

Windows_Logo

Linux_Logo

USB 2.0

USB 3.0

GigE

USB 2.0

USB 3.0

GigE

Syntax

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

Description

With the is_IO() function you control all flash and trigger functions and the additional digital outputs (GPIOs) of some uEye models. For information on GPIO wiring, please refer to the Electrical Specifications chapter.

Additionally you can toggle the color of the LED on the back of the USB uEye SE/RE camera housing.

Hinweis

The GPIOs are available with the GigE uEye HE, USB 3 uEye CP and USB uEye ME/LE (board level only) cameras. The GPIOs are not provided with optocouplers and use TTL voltages. For information on GPIO wiring, please refer to the Electrical specifications chapter.

Rolling shutter cameras:
Using is_IO(), you can determine the times required to implement a global flash function for rolling shutter cameras. This way, a rolling shutter camera can also be used as a global shutter camera provided that no ambient light falls on the sensor outside the flash period.
If the exposure time is set too short so that no global flash operation is possible, the function returns IS_NO_SUCCESS.

Hinweis

To use a rolling shutter camera with the global start function, first call the is_SetGlobalShutter() function. Otherwise, incorrect values will be returned for Delay and Duration.

Global shutter cameras:
In freerun mode, the exposure of global shutter cameras is delayed if the exposure time is not set to the maximum value. is_IO() determines the required delay in order to synchronize exposure and flash operation. In triggered mode, the return values for delay and flash duration are 0, since no delay is necessary before exposure starts.

For further information, please refer to the chapters Camera basics: Shutter methods, Digital input/output (trigger/flash) and Operating modes.

Achtung

Note on the accuracy of flash synchronization

The following parameters have an influence on the camera's internal timing:

Image geometry (CMOS and CCD sensors)

Pixel clock (CMOS and CCD sensors)

Exposure time (CCD sensors)

If you change any of these parameters, you will have to set the flash duration and flash delay parameters once again.

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.

Hinweis

Note: The following functions are obsolete by the is_IO() function:

is_GetGlobalFlashDelays()

is_SetFlashDelay()

is_SetFlashStrobe()

is_SetIO()

is_SetIOMask()

is_SetLED()

See also: Obsolete functions

Übergabeparameter

hCam

Camera handle

IS_IO_CMD_GPIOS_GET_SUPPORTED

Returns the supported GPIO ports (Example 1)

IO_FLASH_GPIO_PORT_MASK (IO_FLASH_MODE_GPIO_1 | IO_FLASH_MODE_GPIO_2)

IS_IO_CMD_GPIOS_GET_SUPPORTED_INPUTS

Returns the supported GPIO inputs (Example 1)

IS_IO_CMD_GPIOS_GET_SUPPORTED_OUTPUTS

Returns the supported GPIO outputs (Example 1)

IS_IO_CMD_GPIOS_GET_DIRECTION

Returns the input/output mask of the GPIOs (Example 2)

IS_IO_CMD_GPIOS_SET_DIRECTION

Set the GPIO on input/output (Example 2)

IO_FLASH_MODE_GPIO_1: Sets GPIO 1 as outout.

IO_FLASH_MODE_GPIO_2: Sets GPIO 2 as output.

IS_IO_CMD_GPIOS_GET_STATE

Returns the state of the GPIO (High, Low) (Example 2)

IS_IO_CMD_GPIOS_SET_STATE

Sets the state of the GPIOs if they are defined as output (High, Low) (Example 2)

IS_IO_CMD_LED_GET_STATE

Returns the state of the LED (Example 3)

IS_IO_CMD_LED_SET_STATE

Sets the state of the LED (Example 3)

IO_LED_STATE_1: Sets LED to orange.

IO_LED_STATE_2: Sets LED to green.

IS_IO_CMD_LED_TOGGLE_STATE

Toggles between the LED states (Example 3)

IS_IO_CMD_FLASH_GET_GLOBAL_PARAMS

Returns the parameters for the global exposure window (Example 4)

IS_IO_CMD_FLASH_APPLY_GLOBAL_PARAMS

Returns the parameters for the global exposure window and sets them as flash parameters (Examplel 4)

IS_IO_CMD_FLASH_GET_PARAMS_MIN

Returns the minimum possible values for flash delay and duration (Example 5)

IS_IO_CMD_FLASH_GET_PARAMS_MAX

Returns the maximum possible values for flash delay and duration (Example 5)

IS_IO_CMD_FLASH_GET_PARAMS_INC

Returns the increments for flash delay and duration (Example 5)

IS_IO_CMD_FLASH_GET_PARAMS

Returns the current values for flash delay and duration (Example 5)

IS_IO_CMD_FLASH_SET_PARAMS

Sets the current values for flash delay and duration (Example 5)

IS_IO_CMD_FLASH_GET_SUPPORTED_GPIOS

Returns the GPIOs which can be used for flash output (Example 6)

IS_IO_CMD_PWM_GET_SUPPORTED_GPIOS

Returns the GPIOs which can be used for pulse-width modulation (PWM) (Example 6)

IS_IO_CMD_FLASH_GET_MODE

Returns the current flash mode, see below (Example 7)

IS_IO_CMD_FLASH_SET_MODE

Sets the flash mode (Example 7)

IO_FLASH_MODE_OFF: Disables the digital output.

IO_FLASH_MODE_TRIGGER_LO_ACTIVE: Enables the flash strobe in trigger mode. The digital output is set to low level for the flash duration.

IO_FLASH_MODE_TRIGGER_HI_ACTIVE: Enables the flash strobe in trigger mode. The digital output is set to high level for the flash duration.

IO_FLASH_MODE_CONSTANT_HIGH: Statically sets the digital output to high level (HIGH).

IO_FLASH_MODE_CONSTANT_LOW: Statically sets the digital output to low level (LOW).

IO_FLASH_MODE_FREERUN_LO_ACTIVE: Enables the flash strobe in freerun mode. The digital output is set to low level for the flash duration.

IO_FLASH_MODE_FREERUN_HI_ACTIVE: Enables the flash strobe in freerun mode. The digital output is set to high level for the flash duration.

IS_IO_CMD_PWM_GET_PARAMS_MIN

Returns the minimum possible values for PWM parameters (Example 8)

IS_IO_CMD_PWM_GET_PARAMS_MAX

Returns the maximum possible values for PWM parameters (Example 8)

IS_IO_CMD_PWM_GET_PARAMS_INC

Returns the increments of the PWM parameters (Example 8)

IS_IO_CMD_PWM_GET_PARAMS

Returns the current values of the PWM parameters (Example 8)

IS_IO_CMD_PWM_SET_PARAMS

Sets the current values of the PWM parameters (Example 8)

IS_IO_CMD_PWM_GET_MODE

Returns the current PWM mode (Example 9)

IS_IO_CMD_PWM_SET_MODE

Sets the current PWM mode (Example 9)

IS_FLASH_MODE_PWM: Sets the flash output as output for PWM mode.

IO_GPIO_1: Sets GPIO 1 as output.

IO_GPIO_2: Sets GPIO 2 as output.

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 IO_FLASH_PARAMS structure

UINT

u32Delay

Flash delay (in μs)

UINT

u32Duration

Flash duration (in μs)

If 0 is passed, the flash output will be active until the end of the exposure time. For sensors with Global Start Shutter this is the time until the end of exposure of the last sensor row.

Contents of the IO_PWM_PARAMS structure

double

dblFrequency_Hz

Frequency of the pulse-width modulation (PWM)

double

dbl_DutyCycle

Duty cycle of the pulse-width modulation

0.0…1.0 (1.0 corresponds to 100 %)

Return values

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_INVALID_CAMERA_HANDLE

Invalid camera handle

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_SUPPORTED

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

IS_SUCCESS

Function executed successfully

IS_TRIGGER_ACTIVATED

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

IS_TRIGGER_NOT_ACTIVATED

The function is not possible as trigger is disabled.

Example 1

INT nRet = IS_SUCCESS;
 
UINT nSupportedIOs = 0;
nRet = is_IO(m_hCam, IS_IO_CMD_GPIOS_GET_SUPPORTED,
            (void*)&nSupportedIOs, sizeof(nSupportedIOs));
 
UINT nSupportedInputs = 0;
nRet = is_IO(m_hCam, IS_IO_CMD_GPIOS_GET_SUPPORTED_INPUTS,
            (void*)&nSupportedInputs, sizeof(nSupportedInputs));
 
UINT nSupportedOutputs = 0;
nRet = is_IO(m_hCam, IS_IO_CMD_GPIOS_GET_SUPPORTED_OUTPUTS,
            (void*)&nSupportedOutputs, sizeof(nSupportedOutputs));

Example 2

INT nRet = IS_SUCCESS;
 
UINT nDirection = 0;
 
// Get direction
nRet = is_IO(m_hCam, IS_IO_CMD_GPIOS_GET_DIRECTION,
            (void*)&nDirection, sizeof(nDirection));
 
// Set GPIO1 and GPIO2 to output
nDirection = IO_GPIO_1 | IO_GPIO_2;
nRet = is_IO(m_hCam, IS_IO_CMD_GPIOS_SET_DIRECTION,
            (void*)&nDirection, sizeof(nDirection));
 
// Get the current state of the GPIOs
UINT nCurrentState = 0;
nRet = is_IO(m_hCam, IS_IO_CMD_GPIOS_GET_STATE,
            (void*)&nCurrentState, sizeof(nCurrentState));
 
// Set GPIO1 to high, GPIO2 to low
nCurrentState = IO_GPIO_1;
nRet = is_IO(m_hCam, IS_IO_CMD_GPIOS_SET_STATE,
            (void*)&nCurrentState, sizeof(nCurrentState));

Example 3

INT nRet = IS_SUCCESS;
 
UINT nLED = 0;
 
// Get the current state of the LED
nCurrentState = 0;
nRet = is_IO(m_hCam, IS_IO_CMD_LED_GET_STATE,
            (void*)&nCurrentState, sizeof(nCurrentState));
 
// Set LED to state 1 (red)
nCurrentState = IO_LED_STATE_1;
nRet = is_IO(m_hCam, IS_IO_CMD_LED_SET_STATE,
            (void*)&nCurrentState, sizeof(nCurrentState));
 
// Toggle LED state to green
nRet = is_IO(m_hCam, IS_IO_CMD_LED_TOGGLE_STATE, NULL, 0);

Example 4

INT nRet = IS_SUCCESS;

 

// Read the global flash params

IO_FLASH_PARAMS flashParams;

INT nRet = is_IO(m_hCam, IS_IO_CMD_FLASH_GET_GLOBAL_PARAMS,
                (void*)&flashParams, sizeof(flashParams));

if (nRet == IS_SUCCESS)

{

  UINT nDelay   = flashParams.u32Delay;

  UINT nDuration = flashParams.u32Duration;

}

 

// Read the global flash params and set the flash params to these values

INT nRet = is_IO(m_hCam, IS_IO_CMD_FLASH_APPLY_GLOBAL_PARAMS, NULL, 0);

Example 5

INT nRet = IS_SUCCESS;

 

IO_FLASH_PARAMS flashParams;

 

// Get the minimum values for flash delay and flash duration

nRet = is_IO(m_hCam, IS_IO_CMD_FLASH_GET_PARAMS_MIN,
            (void*)&flashParams, sizeof(flashParams));

if (nRet == IS_SUCCESS)

{

  UINT nFlashDelayMin   = flashParams.u32Delay;

  UINT nFlashDurationMin = flashParams.u32Duration;

}

 

// Get the maximum values for flash delay and flash duration

nRet = is_IO(m_hCam, IS_IO_CMD_FLASH_GET_PARAMS_MAX,
            (void*)&flashParams, sizeof(flashParams));

if (nRet == IS_SUCCESS)

{

  UINT nFlashDelayMax   = flashParams.u32Delay;

  UINT nFlashDurationMax = flashParams.u32Duration;

}

 

// Get the increment for flash delay and flash duration

nRet = is_IO(m_hCam, IS_IO_CMD_FLASH_GET_PARAMS_INC,
            (void*)&flashParams, sizeof(flashParams));

if (nRet == IS_SUCCESS)

{

  UINT nFlashDelayInc   = flashParams.u32Delay;

  UINT nFlashDurationInc = flashParams.u32Duration;

}

 

// Get the current values for flash delay and flash duration

nRet = is_IO(m_hCam, IS_IO_CMD_FLASH_GET_PARAMS,
            (void*)&flashParams, sizeof(flashParams));

if (nRet == IS_SUCCESS)

{

  UINT nCurrentFlashDelay   = flashParams.u32Delay;

  UINT nCurrentFlashDuration = flashParams.u32Duration;

}

 

// Set the current values for flash delay and flash duration

nRet = is_IO(m_hCam, IS_IO_CMD_FLASH_SET_PARAMS,
            (void*)&flashParams, sizeof(flashParams));

Example 6

INT nRet = IS_SUCCESS;

 

// Get all GPIOs that can be used as flash output

UINT nGPIOs_Flash = 0;

INT nRet = is_IO(m_hCam, IS_IO_CMD_FLASH_GET_SUPPORTED_GPIOS,
                (void*)&nGPIOs_Flash, sizeof(nGPIOs_Flash));

 

// Get all GPIOs that can be used for the PWM

UINT nGPIOs_PWM = 0;

INT nRet = is_IO(m_hCam, IS_IO_CMD_PWM_GET_SUPPORTED_GPIOS,
                (void*)&nGPIOs_PWM, sizeof(nGPIOs_PWM));

Example 7

INT nRet = IS_SUCCESS;

 

// Disable flash

UINT nMode = IO_FLASH_MODE_OFF;

nRet = is_IO(m_hCam, IS_IO_CMD_FLASH_SET_MODE, (void*)&nMode, sizeof(nMode));

 

// Set the flash to a constant low output

nMode = IO_FLASH_MODE_CONSTANT_LOW;

nRet = is_IO(m_hCam, IS_IO_CMD_FLASH_SET_MODE, (void*)&nMode, sizeof(nMode));

 

// Set the flash to a high active pulse for each image in the trigger mode

nMode = IO_FLASH_MODE_TRIGGER_HI_ACTIVE;

nRet = is_IO(m_hCam, IS_IO_CMD_FLASH_SET_MODE, (void*)&nMode, sizeof(nMode));

 

// Get the current flash mode

nRet = is_IO(m_hCam, IS_IO_CMD_FLASH_GET_MODE, (void*)&nMode, sizeof(nMode));

Example 8

INT nRet = IS_SUCCESS;

 

IO_PWM_PARAMS m_pwmParams;

 

// Get the minimum values of the PWM parameters

nRet = is_IO(m_hCam, IS_IO_CMD_PWM_GET_PARAMS_MIN,
            (void*)&m_pwmParams, sizeof(m_pwmParams));

if (nRet == IS_SUCCESS)

{

  double dblFrequencyMin = m_pwmParams.dblFrequency_Hz;

  double dblDutyCycleMin = m_pwmParams.dblDutyCycle;

}

 

// Get the maximum values of the PWM parameters

nRet = is_IO(m_hCam, IS_IO_CMD_PWM_GET_PARAMS_MAX,
            (void*)&m_pwmParams, sizeof(m_pwmParams));

if (nRet == IS_SUCCESS)

{

  double dblFrequencyMax = m_pwmParams.dblFrequency_Hz;

  double dblDutyCycleMax = m_pwmParams.dblDutyCycle;

}

 

// Get the increment of the PWM parameters

nRet = is_IO(m_hCam, IS_IO_CMD_PWM_GET_PARAMS_INC,
            (void*)&m_pwmParams, sizeof(m_pwmParams));

if (nRet == IS_SUCCESS)

{

  double dblFrequencyInc = m_pwmParams.dblFrequency_Hz;

  double dblDutyCycleInc = m_pwmParams.dblDutyCycle;

}

 

// Get the current values of the PWM parameters

nRet = is_IO(m_hCam, IS_IO_CMD_PWM_GET_PARAMS,
            (void*)&m_pwmParams, sizeof(m_pwmParams));

if (nRet == IS_SUCCESS)

{

  double dblFrequency = m_pwmParams.dblFrequency_Hz;

  double dblDutyCycle = m_pwmParams.dblDutyCycle;

}

 

// Set the current values of the PWM parameters (1 KHz, 50% duty cycle)

m_pwmParams.dblFrequency_Hz = 1000;

m_pwmParams.dblDutyCycle = 0.5;

nRet = is_IO(m_hCam, IS_IO_CMD_PWM_SET_PARAMS,
            (void*)&m_pwmParams, sizeof(m_pwmParams));

Example 9

INT nRet = IS_SUCCESS;

 

// Set GPIO1 as PWM output

UINT nMode = IO_GPIO_1;

nRet = is_IO(m_hCam, IS_IO_CMD_PWM_SET_MODE,
            (void*)&nMode, sizeof(nMode));

 

// Set GPIO1, GPIO2 and the flash pin as PWM output

nMode = IO_GPIO_1 | IO_GPIO_2 | IS_FLASH_MODE_PWM;

nRet = is_IO(m_hCam, IS_IO_CMD_PWM_SET_MODE, (void*)&nMode, sizeof(nMode));

 

// Get the current PWM mode

nRet = is_IO(m_hCam, IS_IO_CMD_PWM_GET_MODE, (void*)&nMode, sizeof(nMode));


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