05.91 7 Parameters
7.5 Programming examples with parameters
Example: Rectangle
The subroutine below permits a rectangle, with variable ratio of sides, which are parallel to the
machine axes, to be machined in the X-Y plane.
%300
L
F
N26 G90 X . . . Y . . .
L
F
(First starting position of current program)
N27 R0=60 R1=30. R2=5. R3=8. L46 P1
L
F
N28 G90 X . . . Y . . .
L
F
(Second starting position)
N29 R0=40. L46 P1
L
F
Subroutine
L 46
L
F
N05 G01 G91 Z=–R2
L
F
N10 G64 X=R0
L
F
N15 G02 X=R3 Y=–R3 J=–R3
L
F
N20 G01 Y=–R1
L
F
N25 G02 X=–R3 Y=–R3 I=–R3
L
F
N30 G01 X=–R0
L
F
N35 G02 X=–R3 Y=R3 J=R3
L
F
N40 G01 Y=R1
L
F
N45 G02 G60 X=R3 Y=R3 I=R3
L
F
N50 G01 Z=R2
L
F
N55 M17
L
F
Rectangle
(N 29 )
R0=40 mm
R0=60 mm
R2 = Infeed depth of Z axis
B1 = Starting and end positions of subroutine
Y B1
R3=8 mm
(N 27 )
30 mm
R2=5 mm
R1
B1
R3=8 mm
30 mm R1
R2=5 mm
X
a
a
a
W
Rectangle depth
Rectangle depth
© Siemens AG 1991 All Rights Reserved 6ZB5 410-0HD02 7–7
SINUMERIK 880, (PG)