MachiningBlog.com

View Original

CNC Programming Basics

  • Each program has a program number, that should be different from other program numbers

  • Each line of code in a CNC program is called a “Block”. It contains G and M codes in it.

  • The block cannot have two M-codes in it

  • The ending of a Block has a End-of-Block symbol and it is a semi-colon. (Example: G1X.5; )

  • The last programmed feed rate is the one that will be used on G1 lines of code

  • Any code inside ( ) does not get read by the CNC controller, thus they can be notes for the operator


The Order of a CNC Program

  1. The Program Number

  2. A Tool Change Call

  3. Define a Tool Length Offset Number

  4. Define a Work Coordinate System Number

  5. Tool Path Code

  6. Axis Zero Return

  7. End of the Program