EPSON 自带CCD图像处理包的典型应用框架
Function main
'********************************************
' Very important statement below: Use the * //非常重要的是在实际运行时,用合适的Z数值代替预定义的 ZHeight 。
' Z height which you wrote down earlier in *
' Step 3 of "Teaching Robot Points for use *
' with Vision Guidance. Substitute the *
' Z height value (a negative number) which *
' you wrote down in the place of the xx *
' shown below. *
'********************************************
#define ZHeight -xx
Real area, x, y, u
Boolean found
Integer answer
String msg$, answer$
Power Low 'Run robot at a slow speed and accel
Tool 1 'Use Tool 1 for positioning
Jump safept 'Move robot to safe start position
Do 'Continue looping until user stops
Jump camshot 'Move robot to take picture
VRun blobtut 'Run the vision sequence blobtut
VGet blobtut.washer.RobotXYU, found, x, y, u
If found = TRUE Then //判断 found 的值很重要,在将机器人移动到装配位置之前,判断是否找到了要装配的工件。如果没找到,进行另外的分支处理。
VGet blobtut.washer.area, area
Print "The washer was found!"
Print "The washerarea is: ", area, "Pixels"
washpos = XY(x, y, ZHeight, u) 'Set pos to move to
Jump washpos
msg$ = "The washer was found!"
Else
msg$ = "The washer was not found!"
EndIf
msg$ = msg$ + Chr$(B) + Chr$(10) + "Run another cycle(Y/N)?"
Print msg$
input answer$
If Ucase$(answer$)<> "Y" Then
Exit Do
EndIf
Loop
Fend