VTeach Statement

Applies To
Vision Objects: ColorMatch, Correlation, DefectFinder, Geometric, ImageOp, OCR, Polar, Contour

Description
VTeach enables you to teach a vision model from a SPEL+ program.

Usage

VTeach Sequence.Object, var [, addSample [, keepDontCares] ]
Sequence
Name of a sequence or string variable containing a sequence name.
Object
Name of an object or string variable containing an object name. The object must exist in the specified sequence.
addSample
“True” if a sample is added, or “False” if added as a new model. Optional. If omitted, it is added as a new model.
keepDontCares
“True” if the existing don’t care pixels are used, or “False” if cancelled.
var
Integer variable that will contain the return status.

Values
Returns status in var.

If the teach operation was successful, var will contain 1, otherwise it will contain 0. 0 is returned if the sequence or object did not exist, or if there was insufficient data in the image to teach the model.

Remarks
The object must exist before you can call VTeach. When VTeach executes, an image is acquired first. Next, all previous ImageOp objects are run. Then the model is taught using the current model window. When using the ColorMatch or ImageOp objects, you must first set the CurrentModel property before executing VTeach.

After executing VTeach, you must call VSave to make the changes permanent.

Example

Integer status

VTeach seq1.corr01, status
If status = 1 Then
    VSave
EndIf

See Also
CurrentModel Property, VSaveModel, VTrain