8-47
8
ROBOT LANGUAGE
8-5 Sample Programs
8-5-13
Picking up 3 kinds of workpieces conveyed by the conveyor
and placing them on the 3×3, 3×4, 4×4 transfer pallets while
sorting
General-purpose input
DI1 Workpiece A identification 1: Detected 0: No
DI2 Workpiece B identification 1: Detected 0: No
DI3 Workpiece C identification 1: Detected 0: No
DI4 Workpiece A pallet 1: Set 0: No
DI5 Workpiece B pallet 1: Set 0: No
DI6 Workpiece C pallet 1: Set 0: No
Y
P0
X
Point C
(=P253)
Point D
(=P254)
Point A
(=P251)
Point B
(=P252)
Point c
(=P249)
Point d
(=P250)
Point a
(=P247)
Point b
(=P248)
Point
χ
(=P245)
Point δ
(=P246)
Point α
(=P243)
Point β
(=P244)
■ Teaching each point of P0 and P243 to P254 should be completed beforehand in PNT
(point) mode. (Pallet for workpiece A is defined as pallet 0, pallet for workpiece B as
pallet 1, and pallet for workpiece C as pallet 2 in this example.)
Program Comment
[NO0] <<Main routine>>
001: MAT 3, 3, 0 ; Defines 3×3 matrix (for workpiece A)
002: MAT 3, 4, 1 ; Defines 3×4 matrix (for workpiece B)
003: MAT 4, 4, 2 ; Defines 4×4 matrix (for workpiece C)
004: CSEL 0
; Sets array element of counter array variable C to 0
005: C 1 ; Sets counter array variable C[0] to 1
006: CSEL 1
; Sets array element of counter array variable C to 1
007: C 1 ; Sets counter array variable C[1] to 1
008: CSEL 2
; Sets array element of counter array variable C to 2
009: C 1 ; Sets counter array variable C[2] to 1
010: L 0 ; Label definition
011: MOVA 0, 100 ; Moves to feed point
012: CALL 10, 1
; Waits for workpiece and calls workpiece identification routine
013: CALL 5, 1 ; PICK routine call
014: JMPB 1, 1, 1 ; Jumps to L1 when DI1=1 (workpiece A)
015: JMPB 2, 2, 1 ; Jumps to L2 when DI2=1 (workpiece B)
016: JMPB 3, 3, 1 ; Jumps to L3 when DI3=1 (workpiece C)
017: JMP 0, 0 ; Jumps to L0
018: L 1 ; Label definition
019: CALL 1, 1 ; Calls subroutine NO1
020: JMP 0, 0 ; Jumps to L0
021: L 2 ; Label definition
022: CALL 2, 1 ; Calls subroutine NO2
023: JMP 0, 0 ; Jumps to L0
024: L 3 ; Label definition
025: CALL 3, 1 ; Calls subroutine NO3
026: JMP 0, 0 ; Jumps to L0
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com