Please enable JavaScript to view this site.

IDS Software Suite 4.96.1

Navigation: C: Programming > How to proceed > Saving images and videos

Using the camera memory (GigE uEye cameras)

Scroll Previous Top Next More

Below all functions and parameters are listed which are required for using the memory mode of a GigE uEye camera. The memory mode is enabled via the is_Transfer() function.

is_Transfer()

TRANSFER_CMD_GET_IMAGE_DESTINATION_CAPABILITIES

Returns which memory mode is supported by the camera:

IS_TRANSFER_DESTINATION_DEVICE_MEMORY = 1

IS_TRANSFER_DESTINATION_USER_MEMORY = 2

TRANSFER_CMD_SET_IMAGE_DESTINATION

Sets the current target memory

TRANSFER_CMD_GET_IMAGE_DESTINATION

Returns the current target memory

Example

INT nRet = IS_SUCCESS;
 
/* Check if camera memory is supported */
UINT nCaps = 0;
nRet = is_Transfer(hCam, TRANSFER_CMD_GET_IMAGE_DESTINATION_CAPABILITIES, (void*)&nCaps, sizeof(nCaps));
if ((nRet == IS_SUCCESS) && ((nCaps & IS_TRANSFER_DESTINATION_DEVICE_MEMORY) != 0))
{
  /* Enable camera memory mode */
  TRANSFER_TARGET transferTarget = IS_TRANSFER_DESTINATION_DEVICE_MEMORY;
  nRet = is_Transfer(hCam, TRANSFER_CMD_SET_IMAGE_DESTINATION, (void*)&transferTarget , sizeof(transferTarget ));
}

In memory mode there are four trigger modes (2 per pre- and post-trigger mode) which must be set via the is_SetExternalTrigger() function before they can be used in memory mode. Two of these trigger modes are introduced with version 4.20 and will only work in combination with the memory mode. Therefore, the use of the trigger modes IS_SET_TRIGGER_PRE_HI_LO and IS_SET_TRIGGER_PRE_LO_HI without enabling the memory mode will cause an error when calling the is_CaptureVideo() function.

is_SetExternalTrigger()

IS_SET_TRIGGER_HI_LO

Enables in the memory mode the post-trigger (falling signal edge)

IS_SET_TRIGGER_HI_LO

Enables in the memory mode the post-trigger (rising signal edge)

IS_SET_TRIGGER_PRE_HI_LO

Enables in the memory mode the pre-trigger (falling signal edge)

IS_SET_TRIGGER_PRE_LO_HI

Enables in the memory mode the pre-trigger (rising signal edge)

Additionally the trigger burst size can be set via is_Trigger(). Depending on the set trigger mode you get different results. In post trigger mode the trigger burst returns the number of images which are be requested after a trigger signal from the sensor (snapshot operation, i.e. triggered capture). In pre-trigger mode the camera runs in freerun until a trigger signal is fired. Then n images are captured (n is the trigger burst size). The default value for the trigger burst size is in post-trigger mode 1 and in pre-trigger mode 0.

is_Trigger()

IS_TRIGGER_CMD_GET_BURST_SIZE_SUPPORTED

Returns if the camera supports the burst trigger mode (only GigE uEye cameras)

IS_TRIGGER_CMD_GET_BURST_SIZE_RANGE

Returns the value range, the default value and the increment for the number of images in a burst.

IS_TRIGGER_CMD_GET_BURST_SIZE

Returns the currently set number of images in a burst.

IS_TRIGGER_CMD_SET_BURST_SIZE

Sets the number of images in a burst.

Example

INT nRet = IS_SUCCESS;
 
/* Enable pre-trigger mode */
nRet = is_SetExternalTrigger(hCam, IS_SET_TRIGGER_PRE_HI_LO);
 
/* Set trigger burst size to 5 */
UINT nBurstSize = 5;
nRet = is_Trigger(hCam, IS_TRIGGER_CMD_SET_BURST_SIZE, (void*)&nBurstSize, sizeof(nBurstSize));

The capture is started via is_CaptureVideo(). In this state the camera is waiting continuously for a trigger signal. Each trigger signal starts an iteration. If an iteration is finished, the IS_SET_EVENT_CAMERA_MEMORY event or the IS_CAMERA_MEMORY Windows message is send (if these are enabled). If the camera memory is full, no more iteration is started and the number of missing triggers is incremented. As soon as an iteration is deleted and the camera memory has space again and the camera responds to the trigger signal.

hint_info

Attention: Currently, the continuous waiting for the trigger signal cannot be interrupted by is_StopLiveVideo() because the access to the camera memory is no longer possible. Also is_FreezeVideo() is not possible, i.e. it cannot be waited for a single trigger signal as this behavior is technically the equivalent to is_StopLiveVideo(). In a future version this will be possible.

The camera memory is accessed via the is_ImageBuffer() function.

is_ImageBuffer()

IS_IMGBUF_DEVMEM_CMD_GET_AVAILABLE_ITERATIONS

Returns the number of iterations which are currently in the camera memory.

IS_IMGBUF_DEVMEM_CMD_GET_ITERATION_INFO

Returns the information about a specific iteration, e.g. the number of images in the iteration.

IS_IMGBUF_DEVMEM_CMD_TRANSFER_IMAGE

Transfers an image from an iteration in the camera memory to the user buffer on the PC.

IS_IMGBUF_DEVMEM_CMD_RELEASE_ITERATIONS

Releases all iterations up to the given ID in the camera memory.

Example

INT nRet = IS_SUCCESS;
 
ID_RANGE iterationRange;
 
/* Get range of all available iterations */
nRet = is_ImageBuffer(hCam, IS_IMGBUF_DEVMEM_CMD_GET_AVAILABLE_ITERATIONS, &iterationRange, sizeof(iterationRange));
if (nRet == IS_SUCCESS)
{
  UINT u32FirstIterationID = iterationRange.u32First;
  UINT u32LastIterationID = iterationRange.u32Last;
 
  /* Get infos about the first iteration */
  IMGBUF_ITERATION_INFO iterationInfo;
  iterationInfo.u32IterationID = u32FirstIterationID;
 
  INT nRet = is_ImageBuffer(hCam, IS_IMGBUF_DEVMEM_CMD_GET_ITERATION_INFO, &iterationInfo, sizeof(iterationInfo));
  if (nRet == IS_SUCCESS)
  {
      UINT u32FirstImageID = iterationInfo.rangeImageID.u32First;
      UINT u32LastImageID = iterationInfo.rangeImageID.u32Last;
 
      /* Transfer last image to active user buffer */
      IMGBUF_ITEM bufferItem;
      bufferItem.u32ImageID     = u32LastImageID;
      bufferItem.u32IterationID = u32FirstIterationID;
 
      nRet = is_ImageBuffer(hCam, IS_IMGBUF_DEVMEM_CMD_TRANSFER_IMAGE, (void*)&bufferItem, sizeof(bufferItem));
  }
 
  /* Release all iterations up to the last available iteration */
  nRet = is_ImageBuffer(hCam, IS_IMGBUF_DEVMEM_CMD_RELEASE_ITERATIONS, (void*) &iterationRange.u32Last, sizeof(iterationRange.u32Last));
}

Pre-trigger mode (camera runs in freerun mode)

is_CaptureVideo(): The camera waits continuously for trigger signals. Each trigger signal starts a further iteration. If the camera memory is full, further trigger signals are ignored and missing triggers occur. In driver 4.20 accessing the camera memory after is_StopLiveVideo() is not possible. In pre-trigger mode you can also access images that are saved in the camera memory before the trigger signal.

m: trigger burst size

nx: captured images since the last iteration or since the start. The number of images can be queried via dwImageBuffers and dwImageBuffersInUse in the UEYEIMAGEINFO structure (see is_GetImageInfo()).

Fig. 188: Iterations in the camera memory (pre-tigger mode)

Fig. 188: Iterations in the camera memory (pre-tigger mode)

Post-trigger mode (camera runs in "snapshot mode")

is_CaptureVideo(): The camera waits continuously for trigger signals. Each trigger signal starts a further iteration. If the camera memory is full, further trigger signals are ignored and missing triggers occur. In driver 4.20 accessing the camera memory after is_StopLiveVideo() is not possible.

m: trigger burst size

Fig. 189: Iterations in the camera memory (post-tigger mode)

Fig. 189: Iterations in the camera memory (post-tigger mode)

© 2022 IDS Imaging Development Systems GmbH