Sub Program Call


I was experimenting with the M98 sub program call. I inserted a "call" to another program on the USB (program is At the end of the "called" program I have M99, which should return to the main program after the M98 call. It doesn't. It looks like it returns to the beginning of the main program (which promptly runs the M98 again, sticking me in an endless loop). I've attached the main G-code as well as the referenced called program (


    1.5 KB · Views: 14
    40 bytes · Views: 17


MASSO Support
Staff member
Hi Dan,

I had a look at the program and have found your problem. You have an M30 command in the sub program which is the End program and rewind command which sends you right back to the start.

If you remove it from the program should run as expected.
G38.2 Z-6 F20
G92 Z1.3
G0 Z4
M30 (End program and rewind)

Hope this helps




Peter-You are correct. That works. I'm running a 38.2 probing routine at Tool Change to enable the new tool to be at "0" at the top of the work piece. Every time a Tool Change is encountered I can run the touch plate routine and use the thickness of the plate to offset "Z" to the top of the job. I had to change the input from tool setter to probe. Thanks again.