ICogAcqFifo CompleteAcquireEx Method Cognex VisionPro 9.8
Completes the acquisition specified by the requested ticket and returns the acquired image. This method is the same as CompleteAcquire(Int32, Int32 , Int32 ) but passes and returns its results in an ICogAcqInfo.

Namespace: Cognex.VisionPro
Assembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 75.1.0.0
Syntax

ICogImage CompleteAcquireEx(
	ICogAcqInfo info
)

Return Value

Type: ICogImage

The acquired image.

Exceptions

ExceptionCondition
CogAcqTimeoutException

Timeout period expired.

CogAcqBadTicketException

Ticket is −1 and there is no outstanding StartAcquire , or if there is no StartAcquire  for this Ticket.

CogAcqOldTicketException

The image corresponding to Ticket has already been collected.

CogAcqOverrunException

A trigger could not be serviced.

CogAcqAbnormalException

The acquisition failed because of a fault in the acquisition hardware or because of some other unusual problem.

CogAcqEncoderOverrunException

Encoder overrun.

CogAcqInvalidROIException

The region of interest is not valid.

CogAcqNoOutstandingStartsException

Ticket was −1, but there were no outstanding StartAcquire  requests

CogAcqOtherFifoErrorException

There was an error in another FIFO in the same master/slave group.

Remarks

Completes the acquisition specified by the requested ticket and returns the acquired image. This method is the same as CompleteAcquire(Int32, Int32 , Int32 ) but passes and returns its results in an ICogAcqInfo .

Note: If you are completing an automatically triggered acquisition (one for which StartAcquire  was not called), then you must either omit the RequestedTicket property of the info argument or supply a value of -1.

Under some conditions, the VisionPro acquisition system may fire a Complete event when there is no completed acquisition available. If you call CompleteAcquireEx(ICogAcqInfo) when this happens, you will receive a timeout error, or possibly some other error. This happens primarily when you disable triggers and Flush  the FIFO (to stop acquisitions), and the Complete event for the flushed image fires. To avoid this situation, be sure to call GetFifoState(Int32 , Int32 , Boolean ), to determine whether there really is an image pending.

CompleteAcquireEx(ICogAcqInfo) can fire Complete, MovePart, and Overrun.

Examples

using Cognex.VisionPro;

private CogFrameGrabbers myFrameGrabbers;
private ICogFrameGrabber myFrameGrabber;
private ICogAcqFifo myAcqFifo;

             private void AcquireDisplay () {
                    const string VIDEO_FORMAT = "Sony XC75 640x480";
                    int   numPending, numReady;
                    CogAcqInfo info = new CogAcqInfo();
                    bool busy;

                    myFrameGrabbers = new CogFrameGrabbers();
                    myFrameGrabber = myFrameGrabbers[0];
                    myAcqFifo = myFrameGrabber.CreateAcqFifo(VIDEO_FORMAT, Cognex.VisionPro.CogAcqFifoPixelFormatConstants.Format8Grey, 0, false);

                    info.RequestedTicket = myAcqFifo.StartAcquire();

                    do {
                           myAcqFifo.GetFifoState(out numPending, out numReady, out busy);

                           if (numReady > 0)
                                 cogDisplay1.Image = myAcqFifo.CompleteAcquireEx(info);
                    } while (numReady <= 0);
             }
Imports Cognex.VisionPro

Private myFrameGrabbers As CogFrameGrabbers
Private myFrameGrabber As Cognex.VisionPro.ICogFrameGrabber
Private myAcqFifo As Cognex.VisionPro.ICogAcqFifo

Private Sub AcquireDisplay()
    Const VIDEO_FORMAT = "Sony XC75 640x480"
    Dim info As New CogAcqInfo
    Dim numPending As Integer : Dim numReady As Integer : Dim busy As Boolean

    myFrameGrabbers = New CogFrameGrabbers
    myFrameGrabber = myFrameGrabbers.Item(0)
    myAcqFifo = myFrameGrabber.CreateAcqFifo(VIDEO_FORMAT, CogAcqFifoPixelFormatConstants.Format8Grey, 0, False)

    info.RequestedTicket = myAcqFifo.StartAcquire()
    Do
        myAcqFifo.GetFifoState(numPending, numReady, busy)
    Loop Until numReady > 0

    CogDisplay1.Image = myAcqFifo.CompleteAcquireEx(info)
End Sub
See Also