
14. Coordinates System Setting Functions
14.10 Workpiece Coordinate System Setting and Offset
529
(Example 6)
Program example when the added workpiece coordinate system offsets are transferred
to the standard workpiece coordinate system offsets and used.
In this example, the workpiece coordinate system offsets for each workpiece are set
beforehand in P1 to P24 when the workpiece is fixed on a rotating table, as shown in the
drawing below.
B
X
P19
Z
Y
P20
P21
P22
P23
P24
P1
P2
P3
P4
P5
P6
L20000 (Main)
G28 XYZB ;
G90 ;
G00 B0 ;
G65 L2001 A1 ;
G22 L2002 ;
G00 B90. ;
G65 L2001 A7 ;
G22 L2002 ;
G00 B180. ;
G65 L2001 A13 ;
G22 L2002 ;
G00 B270. ;
G65 L2001 A19 ;
G22 L2002 ;
G28 XYB ;
M02 ;
%
Reference position return
Absolute value mode
Position table to face 1
Load workpiece offsets
Drilling
Position table to face 2
Position table to face 3
Position table to face 4
Return to reference position
L2001 Transmission of workpiece offsets
#2=5221 ;
#3=(#1-1)
∗
20+7001 ;
#5=0 ;
WHILE [#5 LT 6] DO1 ;
#6=#6+1 ;
#7=#7+1 ;
Leading No. of workpiece coordinate system variables
Leading No. of added workpiece coordinate
system variables
No. of sets counter clear
Check No. of sets
Set transmission source 1st axis variable No.
Set transmission destination 1st axis variable No.
#4=#4+1 ;
WHILE [#4 LT 6] DO2 ;
#[#6]=#[#7] ;
#6=#6+1 ;
#7=#7+1 ;
#4=#4+1 ;
END2 ;
Clear No. of axes counter
Check No. of axes
Transmit variable data
Set transmission source next axis
Set transmission destination next axis
No. of axes c1
#2=#2+20 ;
#3=#3+20 ;
#5=#5+1 ;
END1 ;
G23 ;
%
Transmission source Set lead of next variable set.
Transmission destination Set lead of next variable set.
No. of sets c1