Acquisition FIFO and Image Throughput
The acquisition FIFO resides in host PC memory and different Cognex frame grabbers provide different amounts of onboard frame buffer memory. Most Cognex frame grabbers use the frame buffer memory as a temporary buffer for each acquired image on its way to the acquisition FIFO. These frame grabbers do not need to read the entire image from the camera before transferring it to the host PC. After exposure is complete, the camera sends the image line by line to the frame grabber which starts transferring lines to the acquisition FIFO as soon as they are received. For example, line 1 can be transferred from the frame grabber to the PC while line 2 is on its way from the camera to the frame grabber. The frame grabber continues transferring lines in this manner until the entire image is transferred to the acquisition FIFO.
When each image arrives in the FIFO, the vision application is notified that an image is available. If the application is not ready for the image, the image remains in the FIFO until the application removes it by calling completeAcq().
For all acquisition FIFOs, the acquisition engine does not queue up more than 32 images per FIFO, regardless of image size, pel pool size, frame grabber image buffer size, or the amount of available host PC memory. (This number is set as ccAcqFifo::kMaxOutstanding.) Once there are 32 images in the acquisition FIFO, your application must deal with the first image in the FIFO before a 33rd image can be acquired. Your application need not process the image, but the image must be removed from the FIFO by calling completeAcq() and stored in host PC memory or discarded, for image acquisition to continue. Your application can call ccAcqFifo::completedAcqs() to determine how many completed acquisitions are currently being held by the FIFO.
As long as your application can continue shuffling images into and out of the FIFO in this fashion, the limit on the number of images acquirable depends only on the amount of available host PC memory. However, once host PC physical memory is exhausted, the overall acquisition speed can no longer run at the full frame rate of the camera-frame grabber combination.
For most applications, if you find the acquisition FIFO’s 32 image buffering capacity is consistently exhausted, your application must either slow down the trigger rate or increase the rate at which images are retrieved and processed.
The exception is an application that acquires a short burst of images at high speed, as might be done for motion analysis. For this kind of application, images can be acquired into a pel buffer array, as shown in this example:
enum { kBuffers=150 };
ccPelBuffer<c_UInt8> pb[kBuffers];
for (imgNum=0; !stopRequested() && imgNum < kBuffers;
++imgNum)
{
// Leave the image where it currently is.
ccAcqImagePtrh img = fifo->completeAcq();
if (img)
pb[imgNum] = img->getGrey8PelBuffer();
}