User manual
ViewFlex v.3.3 2-36 User Manual
1209
Example of Script for Pass/Fail Test
The following script is an example for testing Pass/Fail Models. A Model
refers to the pattern for which you are searching, and the image for which
it is extracted.
The following program will try to find the “x” object by using the x-model
(x.mod). If found, Fail is sent (QCR=“Fail”). If not found, then it will try
to find the “v” object. If found, Pass is sent (QCR=“Pass”). If neither is
found, Error is sent (QCR=“Error”).
For more information on the commands, refer to Inspector’s online help.
Function QCR() As String
Dim x As Integer
I_IMAGE1$ = Insptr.ImgGetCur
Insptr.ImgSetCurrent I_IMAGE1$, R_Def$, ALL_BANDS
' X.mod is a Model Search of object for Fail sign
M_X_MOD$ =
Insptr.PatLoad("C:\Users\Public\Documents\Intelitek\OpenCIM\Projects\\MICROC
IM\WS3\ViewFlex\X.mod")
Insptr.PatSetCur M_X_MOD$
Insptr.ImgConvertType(TO_8U)
Insptr.MeasNew()
x=Insptr.PatFind
If x=1 Then
QCR="Fail"
Else
' V.mod is a Model Search of object for Pass sign
M_Y_MOD$ =
Insptr.PatLoad("C:\Users\Public\Documents\Intelitek\OpenCIM\Projects\MICROCI
M\WS3\ViewFlex\V.mod")
Insptr.PatSetCur M_Y_MOD$
x=Insptr.PatFind
If x=1 Then
QCR="Pass"
Else
QCR="Error"
End If
End If
Insptr.PatClose
Insptr.ImgClose
Insptr.MeasClose
Insptr.CloseAll
End Function