Call sub program with an G65 P(sub pgm no) L(number of repeats)
Use incremental moves in sub program (G91) to perform one pass/retract/increment across.
If you want to start getting clever you could add another couple of arguments to the G65 line to specify a. Total Depth and b. Depth of Cut. You would then remove the L and use logic (macro B) in the sub program to work out required no of repeats.
Your lathe doesn't use G91 for incremental. X and Z are absolute commands, U and W are incremental. Also, you can use M98 to call a sub G65 is usually used for Macro Calls. Lets say you want to make 20 passes:
X24.5 Z2.0 M19 (POSITION TO START POINT, ORIENT SPINDLE)
M98 P0201001 (CALL SUB O1001 20 TIMES)
G30 U0 W0 (RETRACT FOR INDEX)
M30
O1001(SUB)
G00 G98 U0.25 (RAPID UP 0.25MM IN X)
G01 Z-25. F200. (FEED TO DEPTH IN Z)
G00 U-0.20 (RAPID DOWN 0.2MM IN X)
Z2.0 (RAPID TO START IN Z)
M99
Program O1000 will be called 20 times, each pass 0.05 higher than the last:
X24.75
X24.8
X24.85
X24.9
X24.95
...
...
Also, as christinandavid suggests, you could write a macro that does this a little more elegantly with variables, etc.
Old thread but helpful, Thanks. Got my first slotting working with this, but I have a question. If i am making blind keyway without the relief, is there any options to retract the Z-axis with each pass? Lets say 0.05mm with each stroke. Just to slowly escape the chip build up. Machining plastics mostly.
Using this piece of code
X24.5 Z2.0 M19 (POSITION TO START POINT, ORIENT SPINDLE)
M98 P0201001 (CALL SUB O1001 20 TIMES)
G30 U0 W0 (RETRACT FOR INDEX)
M30
O1001(SUB)
G00 G98 U0.25 (RAPID UP 0.25MM IN X)
G01 Z-25. F200. (FEED TO DEPTH IN Z)
G00 U-0.20 (RAPID DOWN 0.2MM IN X)
Z2.0 (RAPID TO START IN Z)
M99