Anda di halaman 1dari 4

'!

TITLE "PRO1" PROGRAM PRO1 '******************************************************************** ' Vision guided (Cognex 5100-1000) SCARA robot program (Orientation) ' see the video at www.rsindustries.com/rsindustries_extendedvideo.html '*******************ASSEMBLY 31309FAA ******************************* TAKEARM ACCEL 100 DECEL 75 DEFIO lvl = WORD, 3584 'define lvl as a word starting at input 3584 of the parrallel I/O card LET I5=0 'reset I5 to zero RESET IO[3840] 'reset any lingering IOs RESET IO[3841] 'reset any lingering IOs RESET IO[3842] 'reset any lingering IOs RESET IO[3864] 'reset any lingering IOs SPEED 75 HOME (-1.73,-650.87,364.00,-384.11) 'set HOME position DRIVEA ( 3 , 364 ) ,S= 100 'retract Z axis---get it up and out of the way GOHOME 'go to HOME position SET IO[3865] 'set @ HOME to Point IO WAIT IO[9] = ON 'wait for start from Point IO/2_O:1/1 SPEED 75 RESET IO[3865] 'reset @ HOME to Point IO MOVE P, (-1.09,-651.74,364.00,-384.11,9) 'above parts @ pickup station MOVE P, @E (-1.09,-651.74,314.90,-384.11,9) 'on parts @ pickup station SET IO[3840] 'on parts to Point IO/wait on gripping DELAY 150 WAIT IO[10] = ON 'wait for part to be gripped from Point IO/2_O:1/2 WAIT IO[12] = ON , 500 'wait for part to be gripped from Point IO/2_O:1/2 IF IO[12] = ON 'if redundant part gripped input on, then continue else fail GOSUB *GRIPPED ELSE GOSUB *FAILED ENDIF *GRIPPED: SPEED 75 MOVE L, (-1.09,-651.74,364.00,-384.11,9) 'above parts @ pickup station SET IO[3864] 'reset robot @ double part position MOVE L, (-5.16,-513.08,364.00,-380.20,9) 'move to approach camera trigger position

RESET IO[3864] 'reset robot @ double part position MOVE L, @E (-195.37,-509.92,356.83,-400.46,9) 'move to camera trigger position SET IO[3865] 'set @ clear/home position to Point IO/2_I:8/0 WAIT IO[14] = ON 'camera trigger input from Point IO/2_O:1/6 LET I5=lvl 'let integer 5 = named variable lvl WAIT I5<>I7 , 1000 'wait until I5 is not equal to (previous value) I7 to continue IF lvl>0 'if lvl is greater than 0, continue...else NOGO GOSUB *ASSEMBLE ELSE GOSUB *NOGO ENDIF *ASSEMBLE: SPEED 75 WAIT IO[13] = ON 'wait for PROCEED input from Point IO/2_O:1/5 RESET IO[3865] 'reset @ HOME to Point IO/2_I:8/0 WAIT IO[13] = ON 'wait for PROCEED input from Point IO/2_O:1/5 MOVE L, (-195.15,-366.74,364.00,-400.46,9) 'clear of camera and approaching parts nest @ load station '************************************************************************** MOVE L, @E (-336.09,-260.14,364.00,-400.46+I5,9) 'THETA rotation from Cognex camera on the fly to assembly fixture SPEED 75 '************************************************************************** WAIT IO[13] = ON 'wait for PROCEED input from Point IO/2_O:1/5 DRIVEA (3 , 346.00 ) , S= 100 'lower to assembly nest RESET IO[3840] 'reset on parts to Point IO WAIT IO[10] = OFF 'wait for part to be gripped off from Point IO/2_O:1/2 WAIT IO[12] = OFF SPEED 100 'speed 100% WAIT IO[13] = ON 'wait for PROCEED input from Point IO/2_O:1/5 DRIVEA (3 , 364.00 ) , S= 100 SET IO[3841] 'cycle complete/turn on 2_I:8/2 WAIT IO[13] = ON 'wait for PROCEED input from Point IO/2_O:1/5 MOVE P,(-27.77,-451.75,364.00,-397.48,9) 'return to clear position return from assembly MOVE P, (-1.09,-651.74,364.00,-384.11,9) 'above parts @ pickup station LET I7=I5 'move THETA in I5 to I7 for update comparison during next cycle SET IO[3865] WAIT IO[9] = OFF

'wait for start off from Point IO/2_O:1/1 RESET IO[3841] 'reset/turn off 2_I:8/2 GOSUB *FINISH *NOGO: DRIVEA ( 3 , 364 ) ,S= 100 'retract Z axis before going to home position MOVE L,(-27.77,-296.64,364.00,-397.48,9) 'clear position/approach part nest/approach no go SET IO[3865] 'set @ clear/home position to Point IO/2_I:8/0 DELAY 500 RESET IO[3865] 'reset @ HOME to Point IO SPEED 50 'speed 100% MOVE L,(317.90,-476.70,364.00,-343.79,9) 'above nogo chute MOVE P,(317.90,-476.70,280.48,-343.79,9) 'lower to nogo chute RESET IO[3840] 'reset on parts to Point IO DELAY 250 SET IO[3842] 'robot @ nogo station to Point IO/2_I:8/3 WAIT IO[10] = OFF 'wait for part to be gripped off from Point IO/2_O:1/2 WAIT IO[12] = OFF 'wait for redundant grippers open DELAY 250 MOVE L,(317.90,-476.70,364.00,-343.79,9) 'above nogo chute SET IO[3841] 'cycle complete/turn on 2_I:8/2 MOVE L,(-27.77,-296.64,364.00,-397.48,9) 'clear position/approach part nest/approach no go GOHOME SET IO[3865] 'set @ HOME to Point IO WAIT IO[9] = OFF 'wait for start off from Point IO/2_O:1/1 DELAY 100 RESET IO[3841] 'reset/turn off 2_I:8/2 RESET IO[3842] 'reset/turn off 2_I:8/3 GOSUB *FINISH *FAILED: DRIVEA @ 0 ( 3 , 364 ) ,S= 100 'retract Z axis--quickly GOHOME DELAY 500 SET IO[3865] 'all of these on simultaneously will display a fault to SET IO[3840] 'all of these on simultaneously will display a fault to SET IO[3841] 'all of these on simultaneously will display a fault to SET IO[3842] 'all of these on simultaneously will display a fault to

CompactLogix CompactLogix CompactLogix CompactLogix

SET IO[3864] 'all of these on simultaneously will display a fault to CompactLogix *FINISH: GIVEARM END