CogOCVTool Run Method Cognex VisionPro 9.8
Runs the tool using the current parameter settings.

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

public override void Run()

Implements

ICogTool Run 
Events

Event TypeReason
ICogTool Running

Fires before the tool runs.

ICogChangedEvent Changed

Fires when the tool runs. If the run was successful, results are generated; if the run was not successful, no results are generated and the previous results are cleared. Use RunStatus after CogOCVTool returns or in a Ran event handler to determine whether a run was successful or unsuccessful.

The following state flags may be affected:

    ICogTool Ran

    Fires after the tool runs.

    Exceptions

    ExceptionCondition
    CogSecurityViolationException

    Security is not enabled for this vision tool. See Resolving Security-Related Error Messages for more information.

    CogOperatorNoInputImageException

    InputImage is NULL.

    CogImageNoPixelsException

    InputImage is not allocated.

    ArgumentException

    PatternPosition is NULL.

    CogOperatorNotTrainedException

    The pattern is not trained.

    CogTimeoutExpiredException

    RunTimeTimeout expired.

    CogOCVInvalidPatternPositionException

    The selected space of the PatternPositionis not a valid space of the InputImage's coordinate space tree.

    CogOCVInvalidPatternPositionException

    The selected space name of the PatternPosition is a nonqualified space name and more than one instance of it exists in the space tree of the InputImage.

    CogOCVInvalidPatternPositionException

    The selected space name of the PatternPosition is not a legal space name.

    CogImageBadSelectedSpaceNameException

    The selected space of the InputImage is not a valid space of the InputImage's coordinate space tree.

    CogImageBadSelectedSpaceNameException

    The selected space name of the InputImage is a nonqualified space name and more than one instance of it exists in the space tree of the InputImage.

    CogImageBadSelectedSpaceNameException

    the selected space name of the PatternPosition is not a legal space name.

    CogToolNoOperatorException

    Pattern is NULL.

    Remarks

    Verifies that the Pattern is located in the InputImage at the PatternPosition. Results are placed in Results.

    Note: This method does not actually raise the exceptions listed below. Use the RunStatus property to obtain a ICogRunStatus reference. Then use its Exception property to see if the Run method raised any exceptions.

    See Also