My first attempt at writing a subroutine using M98 and it's a fail.........
G91 (Set *Incremental Mode)
G00 Z.1 (Rapid Positioning to safe Z)
M8 (Flood coolant on command turns on spindle)
G4 P3 (Dwell for spindle to spin up to speed)
M98 P1000 L5 (call O1000 subprogram and Loop 5 times)
G00 Z.1(Rapid Positioning to safe Z)
M9 (all coolant off command to turn off spindle)
G90 (Set *Absolute Mode)
G00 X0 Y0 Z.100 (Rapid home- Z.100)
M30 (Program end and rewind)
O1000 (Subprogram to call)
G01 Z-.500 F3 (Linear Interpolation) (Feedrate 3 Z down -.5)G00 Z.600 (New line to pull cutter up)
G00 Z.600 (Rapid Positioning raises Z .600)
G00 X-.05 (Rapid Positioning moves X over .05)
M99 (return from Subroutine)
%
I missing something somewhere and can't seem to find it.
My machine is using the A as a spinner on my mill and I am trying to cut incremental grooves in a round piece.
It seems for some reason it's not reading the incremental code and each time it moves over in the X it keeps adding to the .100 clearance over the piece and by the time it gets to the last loop is only plunging around .100 and retracting around .600
I tried moving the G91 into the sub program to no avail.
Using Mach3 on my mill.
Any clues or help is greatly appreciated.