12 pr ogr amming examples – HEIDENHAIN TNC 640 (34059x-01) ISO programming User Manual
Page 287

HEIDENHAIN TNC 640
287
8.12 Pr
ogr
amming Examples
N170 L10.0 *
Call machining operation
N180 D00 Q10 P01 +0 *
Reset allowance
N190 D00 Q18 P01 +5 *
Angle increment in the X/Y plane for finishing
N200 L10.0 *
Call machining operation
N210 G00 G40 Z+250 M2 *
Retract in the tool axis, end program
N220 G98 L10 *
Subprogram 10: Machining operation
N230 D01 Q23 P01 +Q11 P02 +Q6 *
Calculate Z coordinate for pre-positioning
N240 D00 Q24 P01 +Q4 *
Copy starting angle in space (Z/X plane)
N250 D01 Q26 P01 +Q6 P02 +Q108 *
Compensate sphere radius for pre-positioning
N260 D00 Q28 P01 +Q8 *
Copy rotational position in the plane
N270 D01 Q16 P01 +Q6 P02 -Q10 *
Account for allowance in the sphere radius
N280 G54 X+Q1 Y+Q2 Z-Q16 *
Shift datum to center of sphere
N290 G73 G90 H+Q8 *
Account for starting angle of rotational position in the plane
N300 G98 L1 *
Pre-position in the spindle axis
N310 I+0 J+0 *
Set pole in the X/Y plane for pre-positioning
N320 G11 G40 R+Q26 H+Q8 FQ12 *
Pre-position in the plane
N330 I+Q108 K+0 *
Set pole in the Z/X plane, offset by the tool radius
N340 G01 Y+0 Z+0 FQ12 *
Move to working depth
N350 G98 L2 *
N360 G11 G40 R+Q6 H+Q24 FQ12 *
Move upward in an approximated "arc"
N370 D02 Q24 P01 +Q24 P02 +Q14 *
Update solid angle
N380 D11 P01 +Q24 P02 +Q5 P03 2 *
Inquire whether an arc is finished. If not finished, return to LBL 2
N390 G11 R+Q6 H+Q5 FQ12 *
Move to the end angle in space
N400 G01 G40 Z+Q23 F1000 *
Retract in the spindle axis
N410 G00 G40 X+Q26 *
Pre-position for next arc
N420 D01 Q28 P01 +Q28 P02 +Q18 *
Update rotational position in the plane
N430 D00 Q24 P01 +Q4 *
Reset solid angle
N440 G73 G90 H+Q28 *
Activate new rotational position
N450 D12 P01 +Q28 P02 +Q9 P03 1 *
Unfinished? If not finished, return to label 1
N460 D09 P01 +Q28 P02 +Q9 P03 1 *
N470 G73 G90 H+0 *
Reset the rotation
N480 G54 X+0 Y+0 Z+0 *
Reset the datum shift
N490 G98 L0 *
End of subprogram
N99999999 %SPHERE G71 *