USB 2.0 USB 3.x GigE |
USB 2.0 USB 3.x GigE |
Syntax
INT is_ImageQueue (HIDS hCam, UINT nCommand, void* pParam, UINT cbSizeOfParams)
Description
is_ImageQueue() enables/disables the queue mode for existing image memory sequences. New images will be added to the end of the queue on arrival (FIFO principle). The image memory sequence has to be created with is_AddToSequence() (see Image memory sequences und Allocating image memory).
Image memories in a sequence with queue mode are automatically locked. The image memories will have to be unlocked with is_UnlockSeqBuf() in order to be re-used in the sequence.
Note that also image capture errors are added to the image queue like images If a call of IS_IMAGE_QUEUE_CMD_WAIT returns the IS_CAPTURE_STATUS return value then you can check by a new call of the function, if any further images were enqueued into the image queue after the error.
Image memory sequences can also be used without queue mode. In this case the current image memory has to be queried with is_GetActSeqBuf() on every frame event. Disadvantage of this proceeding is that at very high frame rates it may happen that additional images arrive between the frame event and accessing/locking the memory. The images arriving in this period will be skipped when you query the current image. When using is_ImageQueue(), however, you can be sure to always receive the oldest image which has not yet been queried. n addition, image memories are automatically locked immediately after receiving the image. This prevents images from being overwritten when very high frame rates and few image memories are used. |
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.
Input parameters
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 IMAGEQUEUEWAITBUFFERS structure
UINT |
timeout |
Waiting time in milliseconds (ms). Value range 0…232-1 If no image are in the sequence and no image is received within the waiting time, the function returns with IS_TIMED_OUT. |
char** |
ppcMem |
Pointer to a variable which will receive the address of the last image in the sequence. |
INT* |
pnMemId |
Pointer to a variable which will receive the sequence ID (position in the sequence list) of the oldest image in the sequence. |
Return values
IS_ACCESS_VIOLATION |
An access violation has occurred. |
---|---|
IS_CANT_COMMUNICATE_WITH_DRIVER |
Communication with the driver failed because no driver has been loaded. |
IS_CAPTURE_STATUS |
A transmission error occurred or there was no image memory available to be filled. You can query the error cause with is_CaptureStatus(). For example, the image memory could be locked and must be unlocked first with is_UnlockSeqBuf(). The parameter IS_CAPTURE_STATUS replaces the previous parameter IS_TRANSFER_FAILED. The parameter IS_TRANSFER_FAILED was moved into the new header file ueye_deprecated.h, which contains all obsolete function definitions and constants. If necessary the header file ueye_deprecated.h can be included in addition to the header file ueye.h. |
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_INVALID_CAMERA_HANDLE |
Invalid camera handle |
IS_INVALID_MEMORY_POINTER |
Invalid pointer or invalid memory ID |
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_NO_SUCCESS |
General error message |
IS_NULL_POINTER |
Invalid array For example, a variable was not initialized correctly or a function was called in the wrong order. |
IS_OPERATION_ABORTED |
The operation was cancelled. For example, waiting for the next image was canceled. |
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
// Init the image queue
is_ImageQueue(hCam, IS_IMAGE_QUEUE_CMD_INIT, NULL, 0);
// Get number of pending items
UINT numberPending = 0;
is_ImageQueue(hCam, IS_IMAGE_QUEUE_CMD_GET_PENDING, &numberPending, sizeof(numberPending));
// Discard pending items
UINT discardItems = numberPending - 1;
is_ImageQueue(hCam, IS_IMAGE_QUEUE_CMD_DISCARD_N_ITEMS, &discardItems, sizeof(discardItems));
// Flush image queue
is_ImageQueue(hCam, IS_IMAGE_QUEUE_CMD_FLUSH, NULL, 0);
// Wait for another image (maybe in a thread)
char *memory;
int id;
IMAGEQUEUEWAITBUFFER waitBuffer;
waitBuffer.timeout = 10000;
waitBuffer.pnMemId= &id;
waitBuffer.ppcMem = &memory;
is_FreezeVideo(hCam, IS_DONT_WAIT);
is_ImageQueue(hCam, IS_IMAGE_QUEUE_CMD_WAIT, (void*)&waitBuffer, sizeof(waitBuffer));
// Now cancel the wait (e.g. shutdown)
is_ImageQueue(hCam, IS_IMAGE_QUEUE_CMD_CANCEL_WAIT, NULL, 0);
// Exit the image queue
is_ImageQueue(hCam, IS_IMAGE_QUEUE_CMD_EXIT, NULL, 0);