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

HEIDENHAIN TNC 640
283
8.12 Pr
ogr
amming Examples
N180 G00 Z+250 M2 *
Retract in the tool axis, end program
N190 G98 L10 *
Subprogram 10: Machining operation
N200 G54 X+Q1 Y+Q2 *
Shift datum to center of ellipse
N210 G73 G90 H+Q8 *
Account for rotational position in the plane
N220 Q35 = ( Q6 - Q5 ) / Q7 *
Calculate angle increment
N230 D00 Q36 P01 +Q5 *
Copy starting angle
N240 D00 Q37 P01 +0 *
Set counter
N250 Q21 = Q3 * COS Q36 *
Calculate X coordinate for starting point
N260 Q22 = Q4 * SIN Q36 *
Calculate Y coordinate for starting point
N270 G00 G40 X+Q21 Y+Q22 M3 *
Move to starting point in the plane
N280 Z+Q12 *
Pre-position in spindle axis to setup clearance
N290 G01 Z-Q9 FQ10 *
Move to working depth
N300 G98 L1 *
N310 Q36 = Q36 + Q35 *
Update the angle
N320 Q37 = Q37 + 1 *
Update the counter
N330 Q21 = Q3 * COS Q36 *
Calculate the current X coordinate
N340 Q22 = Q4 * SIN Q36 *
Calculate the current Y coordinate
N350 G01 X+Q21 Y+Q22 FQ11 *
Move to next point
N360 D12 P01 +Q37 P02 +Q7 P03 1 *
Unfinished? If not finished, return to LBL 1
N370 G73 G90 H+0 *
Reset the rotation
N380 G54 X+0 Y+0 *
Reset the datum shift
N390 G00 G40 Z+Q12 *
Move to setup clearance
N400 G98 L0 *
End of subprogram
N99999999 %ELLIPSE G71 *