18-12
18-5-2. Sample 2
In this sample program, teach a user coordinate system
taking the direction row as “X” and the direction of column
as “Y”.
Specify the row pitch and column pitch with numerical
values.
P1-P2: Placing the work.
Relationship between work and teaching points
P1
Column pitch
Row pitch
Row
Column
Z
Y
X
Work
P2
User coordinate
system
Sample program 1 (Pallet01.prg )
Program Description
TOOL 1:TOOL001 Specify a tool
JUMP START Jump to START
●
MOVEL P1 5.00m/min Specify the shunting point (Before insertion)
●
MOVEL P2 5.00m/min Specify the inserting point
■
:START Operation starting point
SET GI001 =5 Specify the number of rows.
SET GI002 =4 Specify the number of column.
SET LI001 =0 Reset the row counter.
SET LI002 =0 Reset the column counter.
SETEL GD.X#GD003 =100 X element of row pitch
SETEL GD.Y#GD003 =0 Y element of row pitch
SETEL GD.Z#GD003 =0 Z element of row pitch
SETEL GD.X#GD004 =0 X element of column pitch
SETEL GD.Y#GD004 =80 Y element of column pitch
SETEL GD.Z#GD004 =0 Z element of column pitch
■
:LOOP2 For row loop
■
:LOOP1 For column loop
[C ]CALL PICK_UP.prg Pick up a work.
SET GD001 GD003 Assign the row pitch value to the shift variable.
CNVSET LR001 LI001 Convert the row counter into a real number.
MUL GD001 LR001 Multiply the row pitch by (the row counter value –1).
SET GD005 GD004 Assign the column pitch to the shift variable.
CNVSET LR001 LI002 Convert the column counter into a real number.
MUL GD005 LR001 Multiply the column pitch by (the column counter value –1).
ADD GD001 GD005 Row shift value + Column shift value.
SHIFT-ON USER#(1)=GD001 Shift (on the user coordinate system.)
●
MOVEL P1 15.00m/min Move to the shunting point before insertion.
●
MOVEL P2 0.50m/min Move to the inserting point.
[C ]CALL WORK_Rel.prg Release the work.
●
MOVEL P1 5.00m/min Move to the shunting point.
SHIFT-OFF End shift
INC LI001 Add to the row counter.
IF LI001 <GI001 THEN JUMP LOOP1 ELSE NOP If the row counter is less than the preset number of rows,
then jump to LOOP 1.
SET LI001 =0 Reset the row counter.
INC LI002 Add to the column counter.
IF LI002 <GI002 THEN JUMP LOOP2 ELSE NOP If the column counter is less than the preset number of
columns, jump to LOOP 2.
GOHOME MOVEP GPHOME 15 m/min
Move to the shunting point.
STOP End of operation.