Posted by: davidhayden | March 1, 2012

Most Common Turning M Codes for CNC Programming


Most Common Turning M Codes 

The following is a list of Comming CNC Programming M Codes for turning applications.  These are excerpts from 7 Easy Steps to CNC Programming Book II, Beyond the Beginning.

For the list of CNC Programming G codes for turning applications see previous post.

CNC
M Code 

CNC M Code Group 

What CNC M Code does /
How to Use the CNC M Code

M0 / M00 

04 

Program  Stop.  Suspends program execution. 

M1 / M01 

04 

Optional Stop.  Only suspends program execution if the optional stop button on the machine’s operator panel is toggled to optional stop mode. 

M2 / M02 

04 

Program End.  Tells the control it is at the end of the program and resets all the modal commands to the machine. 

M3 / M03 

07 

Modal. Clockwise Spindle Rotation. Starts spindle rotation in a clockwise direction. 

M3 / M04 

07 

Modal. Counter-Clockwise Spindle Rotation. Starts spindle rotation in a counter-clockwise direction. 

M5 / M05 

07 

Spindle Stop.  Stops rotation of spindle. 

M8 / M08 

08 

Flood Coolant On. 

M9 / M09 

08 

Coolant Off. 

M10 

02 

Clamp Chuck. 

M11 

02 

Chuck Un-Clamp. 

M30 

04 

Program End and Rewind.  This command tells the control it has reached the end of the program and resets the cursor to the first line of the program.  Back in the “old days,” the M30 would cause the NC tape to rewind back to the beginning. 

M98 

 

Sub-Program call. (See page 29) 

M99 

 

Return to Main Program. (See page 29) 

M99 

 

Loop program.  When used in a program that was not called as a subprogram, the M99 returns the cursor to the start of the program and continues execution.  This can be handy when running jobs with a bar feeder.  Instead of programming an M30, you can program the last two lines to read:  
            M01;  
            M99; 
The M01 will allow the operator to stop the program for taking breaks, shift change, changing bar stock, or whatever reason.  Until the Optional Stop switch is toggled ON, the machine will keep looping through the program.  

Once the Optional Stop button is toggled ON, the machine will stop just prior to reading the M99.  The operator can do what ever needs doing, then hit the Cycle Start button. The program will resume operations from the beginning. 

Watch for future posts that will feature G and M code lists excerpted from 7 Easy Steps to Cnc Programming . . . Beyond the Beginning


Responses

  1. Thanks for the upload.
    please upload for AMS machines knowledge

  2. This is amazing. I wonder if you can use these same codes to get something like this: http://www.amateurcnc.com/viewtopic.php?f=6&p=1405#p1405


Leave a comment

Categories