| Home > C: Programming > Function descriptions > | History back Previous chapter Next chapter Print |
is_IO |
|
uEye Camera Manual Version 4.00
|
|
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.
|
|
•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.
|
|
•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.
|
|
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.
|
|
Übergabeparameter
hCam |
Camera handle |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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. |
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));
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));
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);
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);
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));
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));
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));
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));
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));