CogAcqFifo8501 CreateEventSink Method Cognex VisionPro 9.5
Create an object in the event thread of this fifo. This allows single-threaded objects to sink acquisition events efficiently.

Namespace: Cognex.VisionPro.FG8501.Implementation.Internal
Assembly: Cognex.VisionPro.FG8501 (in Cognex.VisionPro.FG8501.dll) Version: 69.0.0.0
Syntax

public virtual Object CreateEventSink(
	string progIDOrClassID
)

Parameters

progIDOrClassID
Type: System String

A ProgID or ClassID that identifies the type of object to create.

Return Value

Type: Object

The object that was created.

Implements

ICogAcqFifo CreateEventSink(String)
Remarks

Create an object in the event thread of this CogAcqFifo. This allows single-threaded objects to sink acquisition events efficiently.

This CogAcqFifo's event thread runs at a high priority, which means that the event handler you implement in the specified class will also run at a high priority. You should take care to limit the amount of processing time required to service events.

This function creates an object within the apartment of the acquisition FIFO's event thread but it does not actually connect the FIFO events to the object. In Visual Basic events are connected by assigning the FIFO to a WithEvents variable declared in the class that was created. For example if your event sink class (named MyInspection) contains the following code:

Public WithEvents AcqComplete As CogAcqCompleteEvent Private Sub AcqComplete_Complete(ByVal Ticket As Long, ByVal TriggerNumber As Long) Run the inspection now End Sub

You would use the code shown below to create the event sink class and connect it to the acquisition FIFO event source when your program starts:

Dim FGs As New CogFrameGrabbers, AcqFifo As CogAcqFifo Set AcqFifo = FGs(0).CreateAcqFifo("Sony XC-75 640x480 IntDrv CCF") Dim Inspection As MyInspection Set Inspection = AcqFifo.CreateEventSink("MyProject.MyInspection") Set Inspection.AcqComplete = AcqFifo

Note: If you wish to use this function to implement true multithreading in a Visual Basic 6 application, the object specified by progIDOrClassID must be defined in an ActiveX DLL project.

See Also