I think stucapco may have chopped it a little too far,
you may need to modify the "capsmill" post to have it output in a similar format
- but this is my take on the NC code, ( I currently work a Fanuc OM control mill )
- maximum (1) M-code on any line
Code:
%
O0002 ( ABC-OP1) ( comment on O line shows up on program list page of the machine )
(DATE-DDMMYY) (04-03-2015)
(setup info here)
(tool list here)
( T12 = 14.00 MM. DIA. TWIST DRILL )
( H2 , D42 )
( T9 = 18.00 MM. DIA. END MILL-FINISH-2 FLUTE)
( H9 , D39 )
()
G21 ( inch/metric code check) ( if machine is set to other code, program stops)
G0 G17 G40 G80 G94 M5 ( safety codes)
G91 G28 Z0. ( retract vertical to Z home position )
G90
()
N1
T12 M6 (14.00 MM. DIA. TWIST DRILL) ( load tool )
T9 ( pre-select next tool, only needed if machine has toolchange arm )
()
N11
(DRILL)
G54 ( co-ordinate system selection, always define at the start of each tool operation, reset may change it back to G54 by parameter default )
G0 G90 X15. Y-15.
S636 M3
G43 H12 Z100. M8 ( take up length offset, point to Z100, coolant ON )
G98 G81 Z-30.206 R3. F63.662 ( G98=Retract to R-plane, G99= retract to Z level before canned cycle( in this case Z100. for jumps over clamps etc)
X47.5 G99 ( retract to Z100, before moving to next position
X80. (G98 retract to Z3 ( R value in canned cycle))
X112.5
()
G80 G94 ( cancel canned cycle, units per minute ( in case G95 gets used for any operation )-safety codes)
M5
M9
G91 G28 Z0.
G90 ( always leave it in absolute mode)
M1 ( optional stop here for checking previous machining before swapping tool out)
()
N2
T9 M6 (18.00 MM. DIA. END MILL-FINISH-2 FLUTE)
T12
()
N22
(SIDE MILLING)
G54
G0 G90 X127.500 Y-32.575
S627 M3
G43 H9 Z100. M8
Z3.
G1 Z-4. F70.3
X0. F100.4
G0 Z3.
X127.5
Z-3.5
G1 Z-8. F70.3
X0. F100.4
G0 Z3.
X127.5
Z-7.5
G1 Z-12. F70.3
X0. F100.4
G0 Z3.
X127.5
Z-11.5
G1 Z-13.8 F70.3
X0.F100.4
G0 Z3.
S717 M3
X127.5
Z-13.5
G1 Z-14. F50.2
X0. F71.7
G0 Z3.
X127.5 Y-32.375
G1 Z-14. F50.2
G41 D39 X136.375 F71.7
G3 X127.5 Y-23.5 I-8.875 J0.
G1 X0.
G3 X-8.875 Y-32.375 I0. J-8.875
G1 G40 X0.
G0 Z3.
( SIDE MILLING )
S627 M3
Y2.575
G1 Z-4. F70.3
X127.5 F100.4
G0 Z3.
X0.
Z-3.5
G1 Z-8. F70.3
X127.5 F100.4
G0 Z3.
X0.
Z-7.5
G1 Z-12. F70.3
X127.5 F100.4
G0 Z3.
X0.
Z-11.5
G1 Z-13.8 F70.3
F100.4
X127.5
G0 Z3.
S717 M3
X0.
Z-13.5
G1 Z-14. F50.2
F71.7
X127.5
G0 Z3.
X0. Y2.375
G1 Z-14. F50.2
G41 D39 X-8.875 F71.7
G3 X0. Y-6.5 I8.875 J0.
G1 X127.5
G3 X136.375 Y2.375 I0. J8.875
G1 G40 X127.5
G0 Z3.
()
G80 G94
M5
M9
G91 G28 Z0.
G91 G28 X0. Y0.
G90
M30
%
See how this goes in your machine ( lowercase letters will need to be removed )
The arcs in the finishing paths are the "lead in & lead outs that the CAM system had set,
- you need to understand that function in CAM.
Do not allow the cutter to plunge down while against a finished edge, it will leave gouges
Remember this....cutter comp MUST be taken up ( or cancelled )on a linear move, it cannot be done on an arc