M97 Repeats, as a Loop
Model an M97 L-repeat with a WHILE loop that steps across a G154 offset.
M97 P1000 L4 is a Haas idiom: it calls line N1000 inside the same file four times, returning with M99 — a local subprogram, no separate O-number to lose. Our engine runs one program at a time, so here you'll build the same “do this block N times” behaviour with a WHILE loop. Same shape, one file.
Your turn
Model M97 P1000 L#1 drilling a row of holes. Read the row's start X from the G154 P1 X origin (#14001) into #110. Then loop #1 times: for each pass compute this hole's X into #121 as start + index × pitch (#2), emit G01 X#121 F300, and step the index. Leave the pass count in #100 and the last hole's X in #121.
The machine gives you
#14001 = -300#1 = 4#2 = 25#14001 = 0#1 = 3#2 = 10Your program is run once for each set of conditions. It has to work for all of them.
This is a learning simulation — always prove out a program on the actual control before you cut metal.