GCode Loop Program Not Working

I had a Z Axis movement code that was working on Mach3 but it didn’t work when I had Smoothie play the file. I made some minor changes to the code and it runs now but it does not loop, it only runs once.

Can someone spot what is causing this code to not loop:

O0001
F500
M98 P2 L20 (call sub 20 times)

O0002
G0 Z-1
G0 Z-25
G4 P1
%


My Original code that works with Mach3 was this:

O0001
F20
M98 P2 L20 (call sub 20 times)
M30

O0002
G00 Z0.0
G00 Z-2.7118
G4 P1
M99
%


Imported from wikidot

It’s very simple : Smoothie doesn’t support loops.

On a system like Smoothie, this sort of thing would be more expected to be the work of the “host” program ( because it is a bit too much work for the Smoothie firmware itself ), for example, you could see if the bcnc program supports it, and if it doesn’t you could ask it’s developers to look into adding this.

OK, I’ve got bcnc loaded on the system but I was ssh-ing in so I was looking for a quick and easy test without a GUI for now