??????? 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