CogJob ClassCognex VisionPro 9.8
The CogJob class is the work unit of QuickBuild. It consists of an acquisition FIFO and a collection of vision tools. Each CogJob is associated with a particular camera channel which feeds images to the vision tools for processing. Shutdown  must be called when you are done using the CogJob object.
Inheritance Hierarchy

System Object
  System MarshalByRefObject
    Cognex.VisionPro.Implementation CogObjectBase
      Cognex.VisionPro.Implementation CogSerializableObjectBase
        Cognex.VisionPro.Implementation CogSerializableChangedEventBase
          Cognex.VisionPro.QuickBuild CogJob

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

[SerializableAttribute]
public sealed class CogJob : CogSerializableChangedEventBase, 
	IDeserializationCallback

The CogJob type exposes the following members.

Constructors

  NameDescription
Public methodCogJob 
Default CogJob constructor. The newly constructed CogJob has no name.
Public methodCogJob(Boolean)
CogJob constructor that also creates an empty CogToolGroup. The newly created CogJob can then be used with the CogJob edit control.
Public methodCogJob(String)
CogJob constructor with CogJob name.
Top
Methods

  NameDescription
Public methodCloneParameters
CloneParamters. Internal use only.
Public methodCopyParameters
CopyParameters. Internal use only.
Public methodCreateObjRef
Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
(Inherited from MarshalByRefObject.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetLifetimeService
Retrieves the current lifetime service object that controls the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodImage 
Image() remvoes and returns the oldest image in the image queue. Image() will return null if the image queue is empty. Care must be taken to not remove images from the image queue if the CogJob is running image processing.
Public methodImage(Int32, Boolean)
Image(int,bool) allows any image to be looked at and/or removed from the image queue. Care must be taken to not remove images from the image queue if the CogJob is running image processing.
Public methodImageQueueFlush
Flush/clear the image queue of all images. This method cannot be called while the CogJob is running.
Public methodInitializeLifetimeService
Obtains a lifetime service object to control the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Public methodIOValidate
This function detects all the possible I/O configuration errors and returns them in a string. The user must call this routine after adding a new CogJob to the CogJobManager. This routine enables all the I/O lines, if possible, that are used by this job.
Public methodOnDeserialization
Serialization Callback. Internal use only.
Public methodReset
Reset puts the CogJob into its initial state.
Public methodResetAllStatistics
Reset all statistics to their default states.
Public methodRestartThroughputCalculation
Restart the calculation of the throughput calculations.
Public methodResumeAndRaiseChangedEvent
Re-enables raising of the Changed event after SuspendChangedEvent has been called, and raises the Changed event if the ChangedEventSuspended count is reduced to zero and any changes were made while events were suspended. Must be called once for each call to SuspendChangedEvent.
(Inherited from CogSerializableChangedEventBase.)
Public methodRun
Run the CogJob just once. This Run method uses the RunMode of the CogJob determines which parts (acquisition and/or image processing) actually run.
Public methodRunContinuous
Run the CogJob in a continuous loop. The CogJob will not stop running until Stop() is called. This Run method uses the the RunMode of the CogJob determines which parts (acquisition and/or image processing) actually run.
Public methodShutdown
Shutdown terminates all internal threads inside the CogJob. Shutdown also disposes of any contained acquisition fifo and vision tools. Shutdown must be called to allow the CogJob to cleanly terminate. After the CogJob has shutdown, it cannot be run again. Do not persist (save) a shutdown CogJob, since it cannot be run again, even after de-persisting it.
Public methodStop
Stop forces the CogJob to stop running. Only CogJobs running continuously can be stopped. This method returns immediately and does not wait for the CogJob to stop. Once the CogJob has completely stopped, the Stopped event will be fired. If the CogJob is not running, this method has no effect.
Public methodSuspendChangedEvent
Temporarily suspends the raising of the Changed event. May be called more than once, and a corresponding call to ResumeAndRaiseChangedEvent must be made for each call to SuspendChangedEvent.
(Inherited from CogSerializableChangedEventBase.)
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)
Public methodVisionToolLink(Int32)
Returns the stored CogVTLink object using a integer index.
Public methodVisionToolLink(String)
Returns the stored CogVTLink object using a link name.
Public methodVisionToolLink(String, CogDestinationQueueConstants)
Returns the stored CogVTLink object using a link name and its type.
Public methodVisionToolLinkAdd
Add a new CogVTLink object to the CogJob. A CogVTLink object represents either an input (an image) or output (results collection) to or from the CogJob.
Public methodVisionToolLinkRemove(String)
Remove a CogVTLink object by its link name.
Public methodVisionToolLinkRemove(CogVTLink)
Remove a CogVTLink object by its reference.
Top
Fields

  NameDescription
Public fieldStatic memberSfAcqFifo
Acq Fifo State Flag
Public fieldStatic memberSfAcquisitionRunStatus
Acquisition Run Status State Flag
Public fieldStatic memberSfImageQueueCapacity
Image Queue Capacity State Flag
Public fieldStatic memberSfName
Name State Flag
Public fieldStatic memberSfRealTimeQueueCapacity
Image Queue Capacity State Flag
Public fieldStatic memberSfRemainingRuns
RemainingRuns State Flag
Public fieldStatic memberSfRunCount
Maximum number of job runs State Flag
Public fieldStatic memberSfRunCountEnable
RunCountEnable State Flag
Public fieldStatic memberSfRunMode
Run Mode State Flag
Public fieldStatic memberSfRunStatus
Overall Job Run Status State Flag
Public fieldStatic memberSfStartCount
Start Count State Flag
Public fieldStatic memberSfStartMode
Start Mode State Flag
Public fieldStatic memberSfStartTriggerRate
Start Trigger Rate State Flag
Public fieldStatic memberSfState
Run State State Flag
Public fieldStatic memberSfThroughputAlgorithm
Total Job Throughput Algorithm State Flag
Public fieldStatic memberSfThroughputSampleSize
Total Job Throughput Sample Size State Flag
Public fieldStatic memberSfTotalAcquisitionErrors
Total Acquisition Errors State Flag
Public fieldStatic memberSfTotalAcquisitionOverruns
Total Acquisition Overruns State Flag
Public fieldStatic memberSfTotalAcquisitions
Acquisition Run Status State Flag
Public fieldStatic memberSfTotalEncoderOverruns
Total Encoder Overruns State Flag
Public fieldStatic memberSfTotalJobIterations
Total Job Iterations State Flag
Public fieldStatic memberSfTotalJobThroughput
Total Job Throughput State Flag
Public fieldStatic memberSfTotalJobThroughputMax
Total Job Throughput Max State Flag
Public fieldStatic memberSfTotalJobThroughputMin
Total Job Throughput Min State Flag
Public fieldStatic memberSfTotalVisionToolAccepts
Total Vision Tool Accepts State Flag
Public fieldStatic memberSfTotalVisionToolErrors
Total Vision Tool Errors State Flag
Public fieldStatic memberSfTotalVisionToolRejects
Total Vision Tool Rejects State Flag
Public fieldStatic memberSfTotalVisionToolWarnings
Total Vision Tool Warnings State Flag
Public fieldStatic memberSfVisionTool
Vision Tool State Flag
Public fieldStatic memberSfVisionToolLinkAdd
Vision Tool Link Add State Flag
Public fieldStatic memberSfVisionToolLinkRemove
Vision Tool Link Remove State Flag
Public fieldStatic memberSfVisionToolRunStatus
VisionTool Run Status State Flag
Top
Properties

  NameDescription
Public propertyAcqFifo
Get or set the acquisition fifo.
Public propertyAcqFifoState
Read-only property to get the state of the acq fifo. Internal use only.
Public propertyAcqFifoSyncPulse
Gets an interface to a synchronization pulse. This pulse will be fired from the thread that acquires images, just before each acquisition attempt, allowing you to synchronize with that thread.
Public propertyAcqFifoSyncRoot
Read-only property to get the AcqFifoSyncRoot. Internal use only.
Public propertyAcquisitionProcessThread
Internal use only.
Public propertyAcquisitionRunStatus
Read-only property which returns the AcquisitionRunStatus of the CogJob.
Public propertyChangedEventSuspended
If nonzero, indicates that the raising of the Changed event has been suspended. This value is incremented when SuspendChangedEvent is called and decremented when ResumeAndRaiseChangedEvent is called.
(Inherited from CogSerializableChangedEventBase.)
Public propertyHasChanged (Inherited from CogSerializableChangedEventBase.)
Public propertyHasManager
Read-only property to check if the CogJob has a CogJobManager. Internal use only.
Public propertyImageQueueCapacity
Get or set the image queue capacity.
Public propertyImageQueueCount
Read-only property which returns the number of images in the image queue.
Public propertyIndependentProcessThread
Internal use only.
Public propertyIOInfoList
Returns the CogIOInfoList, which is used to map I/O signals to physical devices in the system. Cognex internal use only
Public propertyJobRunStopSyncRoot
Read-only property to get the JobRunStopSyncRoot. Internal use only.
Public propertyJobScript
Cognex Internal Use Only.
Public propertyManager
Get or set the CogJob's CogJobManager. Internal use only.
Public propertyName
Gets or sets the name of the CogJob.
Public propertyOwnedIndependent
Read-only property to retrieve the CogJobIndependent object.
Public propertyRemainingRuns
Get or set the number of remaining job runs.
Public propertyRunCount
Get or set the maximum number of job runs.
Public propertyRunCountEnable
Enable or disable RunCount
Public propertyRunMode
Get or set the CogJob's RunMode.
Public propertyRunningSyncBoolean
Gets an interface to a synchronization boolean. This boolean will be true if the threads of this job have been told to run and have not yet stopped. Otherwise it will be false.
Public propertyRunStatus
Gets the last RunStatus of the job.
Public propertyScriptError
Cognex Internal Use Only.
Public propertyScriptObj
Cognex Internal Use Only.
Public propertyStartCount
Get or set the number of StartAcquires in the acq fifo's queue.
Public propertyStartMode
Get or set when StartAcquires are put into the acq fifo's queue.
Public propertyStartTriggerRate
Get or set the trigger rate when the CogJob's StartMode is IssuedAtFixedRate.
Public propertyState
Gets the running state of the CogJob.
Public propertyStateFlags
Returns the complete set of state flags supported on this object. The flags may be indexed by name as shown in the following C# code snippet: if (changedObject.StateFlags["Color"] & eventArgs.StateFlags) { ... }
(Inherited from CogSerializableChangedEventBase.)
Public propertyThroughputAlgorithm
Get or set the CogJob throughput algorithm.
Public propertyThroughputSampleSize
Get or set the CogJob throughput sample size.
Public propertyTotalAcquisitionErrors
Get or set the total number of acquisition errors.
Public propertyTotalAcquisitionOverruns
Get or set the total number of acquisition overruns.
Public propertyTotalAcquisitions
Get or set the total number of acquisition completed.
Public propertyTotalEncoderOverruns
Get or set the total number of encoder overruns.
Public propertyTotalJobIterations
Get or set the total number of job iterations.
Public propertyTotalJobThroughput
Get or set the CogJob throughput at a particular instant.
Public propertyTotalJobThroughputMax
Get or set the maximum CogJob throughput.
Public propertyTotalJobThroughputMin
Get or set the mininum CogJob throughput.
Public propertyTotalVisionToolAccepts
Get or set the total number of vision tool runs that had an accept result.
Public propertyTotalVisionToolErrors
Get or set the total number of vision tool runs that had an error result.
Public propertyTotalVisionToolRejects
Get or set the total number of vision tool runs that had a reject result.
Public propertyTotalVisionToolWarnings
Get or set the total number of vision tool runs that had a warning result.
Public propertyUserData
UserData. Internal use only.
Public propertyVisionTool
Get or set the CogJob's VisionTool.
Public propertyVisionToolLinkCount
Read-only property which returns the number of link objects contained within the CogJob.
Public propertyVisionToolRunStatus
Read-only property which returns the RunStatus of the vision tool.
Public propertyVisionToolSyncPulse
Gets an interface to a synchronization pulse. This pulse will be fired from the thread that runs the vision tools, just before each run of the tools, allowing you to synchronize with that thread.
Public propertyVisionToolSyncRoot
Read-only property to get the VisionToolSyncRoot. Internal use only.
Top
Events

  NameDescription
Public eventAcquisitionError
Raised when an acquisition error occurs.
Public eventAcquisitionTimeout
Raised when an acquisition timeout occurs.
Public eventChanged
This event is raised when one or more parts of the object's state may have changed.
(Inherited from CogSerializableChangedEventBase.)
Public eventGarbageCollectionRequested
Raised whenever garbage collection is requested. Internal use only.
Public eventImageAvailable
Raised when a new image is available in the image queue.
Public eventImageQueueFlushed
Raised when the image queue is flushed.
Public eventImageQueueOverflowed
Raised when the image queue overflows.
Public eventImageRemoved
Raised when an image is removed from the image queue.
Public eventIOError
Raised when any I/O error occurs.
Public eventProcessedIOResultAvailable
Raised after the record is removed from the realtime queue and the job internally processes the record for I/O.
Public eventRan
Raised when the CogJob has ran one iteration.
Public eventResetComplete
Raised when the CogJob has been fully reset.
Public eventRunning
Raised when the CogJob has started running.
Public eventStopped
Raised when the CogJob has completely stopped.
Public eventVisionToolError
Raised when a vision tool error occurs.
Public eventVisionToolLinkAdded
Raised when a vision tool link is added.
Public eventVisionToolLinkRemoved
Raised when vision tool link is removed.
Top
Remarks

Shutdown  must be called when you are done using the CogJob object. Failure to call Shutdown  will cause the CogJob to hang.
Examples

See Also