This may be a radius or chamfer along a horizontal edge. The profile then runs the required amount of times going deeper with each pass.Īnother use is to create simple 3D shapes, more commonly referred to as 2.5D shapes.
This is achieved by using an incremental Z axis peck depth and calling up the profile as many times as needed. M97 and M98 can be used to enable you to mill a deep profile by pecking down in depth multiple times. To use M98, the subprogram is separate and usually needs to be in a designated folder on your PC. To use the M97 the subroutine needs to be in the same program that you are running, it has to be positioned after the M30 or M02 at the end of the program. You will have to check the manual for your software. It uses M98 for both subroutine and subprogram calls.
For example mach3, the software I use, does not recognise M97. They can have different rules for using subroutine and subprogram calls. The M99 M code actually works in conjunction with the M98 M code and the M97 M code.Ī very important note here is to warn you that not all Cnc operating software programs work in the same way. You may have heard them described as G code loops or G code repeats. If you are reading this you are probably new to cnc programming and may be wondering how to program subroutines and what they can do.