ICogAcqSimultaneous CreateSlaveAcqFifo Method Cognex VisionPro 9.8
Create a new slave fifo for simultaneous acquisition. The slave fifo will have the same video format as this fifo.

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

ICogAcqFifo CreateSlaveAcqFifo(
	bool autoPrepare
)

Parameters

autoPrepare
Type: System Boolean

Sets the AutoPrepareEnabled property of the acquisition FIFO that specifies whether the FIFO is automatically prepared when a property changes.

Return Value

Type: ICogAcqFifo

The new slave FIFO.

Events

Event TypeReason
ICogChangedEvent Changed

Fires when a slave is created for this FIFO.

The following state flag may be affected:

  • SfSGetSlaves
Exceptions

ExceptionCondition
ArgumentException

FifoType is not in CogAcqFifoPixelFormatConstants.

CogAcqBadVideoFormatException

The video format is not recognized.

CogAcqNotAllowedForSlaveException

This FIFO is already a slave FIFO.

CogAcqCannotSlaveException

This FIFO cannot have a slave FIFO because of incompatible video formats or because there are no available camera ports for slave FIFOs.

Remarks

Creates a new slave acquisition FIFO for simultaneous acquisition with the FIFO associated with this object. The camera port of the slave FIFO is chosen to be compatible with the master FIFO.

For the Cognex MVS-8120/CVM1 the camera port of the first slave FIFO must be one higher that the camera port of the master FIFO. For example, if the master FIFO uses camera port 2, the first slave FIFO will use camera port 3, the second will use camera port 0, and the third will use camera port 1. It is not an error for two FIFOs to share the same camera port, but you may get unexpected behavior. If CreateSlaveAcqFifo(Boolean) cannot find a suitable camera port, it returns an error.

Examples

using Cognex.VisionPro;

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

private void InitializeFifo()
{
    const string VIDEO_FORMAT = "Sony XC75 640x480";
    ICogAcqSimultaneous simParams;

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

    simParams = myAcqFifo.OwnedSimultaneousParams;
    if (simParams != null) {
        ICogAcqFifo slaveFIFO;

        slaveFIFO = simParams.CreateSlaveAcqFifo(True);
    }
}
Imports Cognex.VisionPro

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

Private Sub InitializeFifo()
    Const VIDEO_FORMAT = "Sony XC75 640x480"
    Dim simParams As Cognex.VisionPro.ICogAcqSimultaneous

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

    simParams = myAcqFifo.OwnedSimultaneousParams

    If Not simParams Is Nothing Then
        Dim slaveFIFO As Cognex.VisionPro.ICogAcqFifo

        slaveFIFO = simParams.CreateSlaveAcqFifo(True)
    End If
End Sub
See Also