Fundamentals of CNC Programming: Word Address Format and Program Blocks

CNC Programming

CNC programming is an essential skill in modern manufacturing, allowing precise control over machining processes. One of the core elements of CNC programming is the word address format and the structure of program blocks. Understanding these concepts is crucial for creating efficient and error-free CNC programs.

Word Address Format in CNC Programming

The word address format is the standard method for encoding instructions in CNC programs. It consists of a letter followed by one or more numbers, sometimes including symbols like negative signs or decimal points. Each combination represents a specific command or data point used by the CNC controller to execute precise machining operations.

Common Word Addresses:

  • G codes: Preparatory functions (e.g., G01 for linear interpolation)
  • M codes: Miscellaneous functions (e.g., M30 for program end)
  • X, Y, Z: Coordinate axes
  • F: Feed rate
  • S: Spindle speed
  • T: Tool selection
  • N: Sequence number

Example of word addresses:

  • G01 X15.75 Y30.0 Z-5.14 F120.0 S2500 T01

Structure of Program Blocks

A CNC program is composed of multiple program blocks, each containing a set of word addresses that define specific machining actions. These blocks are executed sequentially to carry out complex machining tasks.

Components of a Program Block:

  1. Sequence Number (N): An optional identifier that helps organize and reference specific blocks.
  2. G Codes: Instructions for motion and path control.
  3. Coordinate Words (X, Y, Z): Define the target positions for the tool.
  4. Feed Rate (F): Specifies the speed at which the tool moves through the material.
  5. Spindle Speed (S): Controls the rotation speed of the cutting tool.
  6. Tool Selection (T): Chooses the appropriate tool for the operation.
  7. Miscellaneous Codes (M): Perform auxiliary functions like starting the spindle or turning on coolant.

Example of a program block:

  • N10 G01 X50.0 Y25.0 Z-10.0 F150.0 S2000 M08

Practical Example: Machining a Simple Part

Let’s walk through the creation of a CNC program for machining a simple rectangular part with a hole.

  1. Initial Setup:
  • Material: Aluminum
  • Tool: 10mm end mill


   N10 G90 G21 (Absolute positioning, metric units)
   N20 T01 M06 (Select tool 1 and change tool)
   N30 S1500 M03 (Set spindle speed and start spindle)
   N40 G00 X0 Y0 Z5 (Move to starting position above the part)
   N50 G01 Z-5 F100 (Feed to cutting depth)
   N60 G01 X50 (Cut along X-axis)
   N70 G01 Y25 (Cut along Y-axis)
   N80 G01 X0 (Return along X-axis)
   N90 G01 Y0 (Return along Y-axis)
   N100 G00 Z5 (Retract tool)
   N110 G00 X25 Y12.5 (Move to hole position)
   N120 G01 Z-5 (Feed to cutting depth)
   N130 G02 I0 J12.5 (Circular interpolation to create hole)
   N140 G00 Z5 (Retract tool)
   N150 M30 (End of program)

This simple example demonstrates how to organize a CNC program using word address format and program blocks to achieve precise machining.

Best Practices for CNC Programming

  1. Consistent Formatting: Keep a consistent format for easier reading and troubleshooting.
  2. Commenting: Use comments to explain complex sections of the code (e.g., (Cut along X-axis)).
  3. Sequence Numbers: Use sequence numbers for easier reference and editing.
  4. Verification: Always simulate the program in a virtual environment to catch errors before actual machining.
Learn more:
Want.Net Technical Team

Want.Net Technical Team

The Want.Net Technical Team has diverse members with extensive education and training in CNC machining. They prioritize precision, efficiency, and innovation to provide high-quality manufacturing solutions globally.

Push Your Order into Production Today!

Table of Contents


You’re one step from the  factory-direct price of part manufacturing services.