M-functionsM00Programmed stop M01Optional stop M02Program end M17End of subroutine M29End of subroutine M30Program end M40 - 45Selection of spindle gear ranges