T I6 r0 K' J3 N$ r, yDim iP0 as POINT $ X7 R& H( a* o0 D: I. g + a( g! y7 V" G! d" l+ O9 V+ B! V( {Dim oP0 as POINT/ ` c& }. x; P1 S% O) C8 @
' p% A9 s% F" u' x9 iDim Angle0 as single ( V% P! C r% e3 _7 T, X6 { ' |! @( L4 D H9 c% }Dim Score0 as single" i" C! d. S# I$ L6 h$ o
7 M6 t/ i$ _0 A2 e! E4 b. NDim Ret0 as Integer+ _9 {; q: R& ^
/ A7 H6 i$ f( ]) @( EDim iP1 as POINT. a& l- q& U1 O. n3 c
% [6 }0 O# S% _& p5 W1 mDim oP1 as POINT: U6 Z, g/ k2 u0 Y+ `. w
2 u" Q- C1 p% h5 K) [. [
Dim Angle1 as single) a7 g2 C# {2 j$ ~
# u& l- k" p2 k1 e/ E
Dim Score1 as single E) o) ~6 c! y, a
7 H$ @$ |4 N! ]+ LDim Ret1 as Integer 4 g1 E8 p# B, ]8 H* I8 e$ t n4 K- A: _" |1 A+ } i) G' A, T# x
Dim oP2 as POINT' A; D0 m5 n8 j0 W5 @
" S9 P5 [/ p4 H# n1 V, S( tDim iP2 as POINT 8 e0 R! H9 H9 d j; @; i. [ " d% ?# y7 \$ f. L" gDim oP3 as POINT , M2 |5 w' c$ d6 i" U' p 0 p# ?; p4 Y, c2 iDim iP3 as POINT + }0 v" H2 ]: M5 _ # W. H. p5 g. l# |, `Dim oP4 as POINT0 f6 L ?+ x" D) ]9 v6 h6 }& D
9 R2 M2 n2 u2 m# k
Dim iP4 as POINT ' ~# x! l, `6 w; }0 @3 t D) V" l, [) G5 Z
Dim oP5 as POINT " U0 h2 C- w$ A) k+ s; e8 J8 f- w7 d. r4 [0 p0 Z! N
Dim iP5 as POINT' O. n5 J3 e/ ?. X0 ^' j3 h
: e8 i' M! B7 L6 H; Q
Dim oP6 as POINT 8 x1 L" Z" Q) w8 D- v1 @% a3 V2 V3 |0 c' |9 p
Dim iP6 as POINT " Y2 d! p2 s8 W% Y: }2 M 5 d% t7 n+ w2 B) ^: B+ | T; IDim oP7 as POINT5 T1 Y2 K3 i3 G) P( y* I! x- T
1 _/ ^/ I2 N3 |! w: Q+ l
Dim iP7 as POINT( w; B+ \* ~& ?- B0 \, e
4 ]' c: ~1 e: B0 o1 `' @8 I+ k5 e'Add variables definition and image grab command here 5 L1 Z$ U2 k$ d3 G; F3 L'Initialize all global variables1 `3 i, C1 s2 {; J
INITIALIZEGLOBALVAR8 F, ?* q+ o, T1 t
0 \) \7 O8 y$ e/ U1 j' k/ ~DO. b- y; i2 t( s3 j9 d
'Capture current Image from Camera22 W- O3 N! ?* y; i
VISGRAB 2 e1 o' N1 Q$ D# p; }
: B: d# v L$ s4 @
'Save Original Target Center : q& G. _% q- s: @9 Z& \5 BSETPOINT 538.000000,454.500000,iP0 - R- ^, y/ c% c9 @ $ a; }4 W- }% V/ X0 G* E6 ?'Pattern Template Match ! ]6 s( ~" y( a; @5 p" CVISPTNMATCH 2,"D:\Vision\Template\Pattern\20151227002.png",2,-50,50,800,1,0,0,0,0,oP0,Angle0,Score0,Ret0 2 \6 e' V t8 s4 ?4 o0 e. g: S( C/ L2 O" s; S& _5 V
'Save Original Target Center , a7 E2 a% Z( X$ Y* SSETPOINT 538.000000,454.500000,iP1 9 q( g& Q4 _6 e% y5 a8 ^6 n- m4 x6 _0 U& R' \1 R3 I' {
'Pattern Template Match . B9 _$ G, \0 y/ B# PVISPTNMATCH 2,"D:\Vision\Template\Pattern\20151227002.png",2,-50,50,800,1,0,0,0,0,oP1,Angle1,Score1,Ret1 4 a$ ]5 {0 D+ i% A) A3 g' M# Z # S0 A, M- Q) s'Find Straight Edges and fit line/ j9 e# A4 t* a% ^( |3 @7 g s6 p
VISFINDEDGELINE2 2,267,372,108,35,iP1.x,iP1.y,oP1.x,oP1.y,Angle1,2,2,5,5,30,0,2,oP2,oP3 ' j% L; Z. \/ z( \# g+ N; k$ G7 q. {5 ~& @
SETPOINT 267.000000,389.216431,iP2 6 K3 a$ n: K b* t6 E3 E [ v: v- R) e& `& r
SETPOINT 375.000000,389.156342,iP34 Q5 b. T9 R2 k: `" _2 T& u; ?
* ?4 u- F" I1 p% ?
'Find Straight Edges and fit line* Q" m0 w& T& u
VISFINDEDGELINE2 2,691,369,115,35,iP1.x,iP1.y,oP1.x,oP1.y,Angle1,2,2,5,5,30,0,2,oP4,oP5' A; d3 G1 D. p) a; n. ]6 k$ i
) ^# [! ?+ g+ Q8 p9 j4 w. P% |
SETPOINT 691.000000,388.234039,iP4 " g6 l8 }2 M* }/ E+ D9 X- V0 K5 P8 o, k2 x E! v& v% U% \6 h
SETPOINT 805.000000,387.670715,iP5 6 c' j2 ]0 `5 U( b4 c# W j2 c4 K* d& y'Find Straight Edges and fit line9 k6 Y# \( V. @+ t$ m+ s
VISFINDEDGELINE2 2,281,496,508,35,iP1.x,iP1.y,oP1.x,oP1.y,Angle1,3,2,5,5,30,0,2,oP6,oP7 P6 S' T1 w' C8 X/ w
, f# H+ g1 d% M& {' E
SETPOINT 281.000000,518.582275,iP6 9 u7 g5 @2 v4 J/ b9 h' o, }2 B0 F' r( J" U7 @, V$ @% [
SETPOINT 789.000000,517.364746,iP7* \1 i) `5 g( o4 c* x
* I2 F6 k$ ?" s" L" ?
'Add your data process procedure and show result here ( X+ Z4 x, ?; p- G
VISDISPLAYTEXT 2,"Start.x",oP6.x,"Start.y",oP6.y,"End.x",oP7.x,"End.y",oP7.y1 s* o5 z6 D$ B& n6 d