3D Computer Graphics in the Real World
My Account Wish List (0) Shopping Cart Checkout
Wittystore
Login
E-Mail Address:
Password:
Forgotten Password
Sign Up Join Us
// `$_SERVER['REQUEST_URI']` to get the current URL and then check if it contains 'latest-blog' // If the user is using the blog the language menu above is not shown so that the blog is only in english
€
€ Euro £ Pound Sterling $ US Dollar
0
0
0 €0.00
Your shopping cart is empty!
Menu
  • Home
  • 3D Models Download
    • Art
    • DIY
    • Ecolife
    • Garden
    • Home
    • Learning
    • Music
    • Sport
    • Style
    • Board Games
    • Office
    • Toys
    • Characters
    • Collections
      • Baby shower
      • Christmas
      • Earrings
      • Halloween
      • Key-chains
      • Movember
      • Phrases
      • Picks
      • Vehicles
      • Vikings
  • Books
  • Hardware
    • Consumables
      • Filaments
      • Materials
      • Accessories
      • Resins
      • Composite Powder
    • 3D Printers
      • By industry
      • By series
      • By application
      • By technology
      • By materials
    • 3D Pens
    • 3D Scanners
    • Laser Engravers & Cutters
  • Software
    • 3D Modelling Software
    • 3D Printing Software
    • AI Software
    • CNC Software
    • Metaverse
    • Video games
  • Upload

    Share your digital creations!

    upload digital content

    UPLOAD

    Become a Wittyer

    Login/Sign up for a "Wittyer Profile" and upload your content with our easy-to-use tool.

    Choose your licence

    Choose the license that best represents your work between commercial or open source options. Check licences here

    Monetize

    For each download, you will receive up to 85% of the net selling price. Check our royalty options here

  • Customizer3D
  • Blogs
  • 3D Models Download
    • Art
    • DIY
    • Ecolife
    • Garden
    • Home
    • Learning
    • Music
    • Sport
    • Style
    • Board Games
    • Office
    • Toys
    • Characters
    • Collections
      • Baby shower
      • Christmas
      • Earrings
      • Halloween
      • Key-chains
      • Movember
      • Phrases
      • Picks
      • Vehicles
      • Vikings
  • Books
  • Hardware
    • Consumables
      • Filaments
      • Materials
      • Accessories
      • Resins
      • Composite Powder
    • 3D Printers
      • By industry
      • By series
      • By application
      • By technology
      • By materials
    • 3D Pens
    • 3D Scanners
    • Laser Engravers & Cutters
  • Software
    • 3D Modelling Software
    • 3D Printing Software
    • AI Software
    • CNC Software
    • Metaverse
    • Video games
  • Customizer3D
  • Blogs
Blog Category
  • Facts & News
  • Guides & Tutorials
    +-
    • Blender Tools and Commands
  • Tech Explained
  • Industry Insights
You may like
programming retro games Unique ear adornments multimaterial 3D printing zombie Architecture projects m3d cookie cutter
Home » Tech Explained » G Code and M Code what's the difference?
24 Nov
Share This:
    Share on Facebook X Post to Tumblr Pin it Submit to Reddit Share on LinkedIn Save to Pinboard Send email

G Code and M Code what's the difference?

24 Nov 2020
Published In: Tech Explained Hits: 5734

In CNC machining, G codes and M codes work together to manufacture parts and components:

  • G code controls the movements of a machine, dictating how and where a machine should move to fabricate a part.
  • M code controls miscellaneous machine functions,this includes instruction on when to turn on or off operations not involved with cutting.

 

M code is a part of the overall program, often called G code. While G commands describe positions, M code directs the machine's actions. While M represents miscellaneous codes, some refer to it as machine code because it controls particular operations of the equipment.

Both G and M codes have specialized uses in programming a CNC machine.

Without M codes, you may direct tools to a spot and tell them to move in a line or arc, but you won't have any success giving more direct commands, like to stop programs, change tools, flood the system with coolant or other actions beyond the three main movements G codes control. That's why you can think of M codes as directing non-cutting operations.

The dialect used for G and M codes varies by machine. 

Using M commands allows the machinist to tell the device to change tools, turn on the spindle, send coolant to the system or open the doors. Dozens of M operations exist, and operators learn how to program to execute desired actions fast.

Other letters have different functions in the program, which tend to be the same, regardless of a machine's dialect.

  • N: The N value gives the line number.
  • G: The G number tells when the tool to move and stop.
  • X, Y, Z: These values indicate the position of the tool in three dimensions — X for horizontal, Y for vertical and Z for depth.
  • F: F relates to how quickly the machine feeds the piece.
  • S: S tells the machine how quickly to move the spindle.
  • T: The T tells the machine which tool to use.
  • M: M values give miscellaneous functions or machine functions, telling the device how to act by giving on and off directions.
  • I and J: These values indicate the incremental center of any arcs the machine makes.
  • R: R gives the radius of arcs made by the machine.
  • A: A values direct the tool around the x-axis.
  • B: The number with B shows the rotational value around the y-axis.
  • C: An auxiliary axis that rotates around the z-axis gets its positional value from the C value.
  • D: This number shows how much the system offsets the tool diameter.
  • L: L gives the system a value to indicate repeating operations and how many times they need to loop.
  • P: The program jumps in time or a delayed time with the P command.

Other alphanumeric designations depend on the machine's capabilities.

Tags: G-code CNC Programming M-Code
Same In Category
  • Blender 2.8x vs Fusion 360
  • What’s the Difference Between PLA, ABS, and Nylon?
  • What is G-Code?
  • What is 3D Printing?
  • What does cnc mean in text?
  • What does cam mean in text?
  • Text2STL: Bridging the Gap in 3D Printing While Awaiting AI Advancements
  • Metaverse the next generation of the web
  • List of M-Codes commonly found on FANUC and similarly designed controls
  • List of G-Codes commonly found on FANUC and similarly designed controls
Related Blogs By Tags
  • What is G-Code?
  • What does cam mean in text?
  • List of M-Codes commonly found on FANUC and similarly designed controls
  • List of G-Codes commonly found on FANUC and similarly designed controls
  • JSCut: Your Free Alternative to MakerCAM for Easy CNC Machining
  • G Code and M Code what's the difference?
Sign in with Sign inSign inSign inSign in

Find us also on:

About us

Wittystore is a company focused on products that are ingeniously clever in conception, execution and expression.

GET IN TOUCH:

 General Enquiries

 Business Enquiries

 Get Support

Information
  • About Us
  • Create Account
  • Privacy Policy
  • Terms & Conditions
  • Advertisement Rates
  • Licences for Digital content
  • Contact Us
Extras
  • Brands
  • Gift Vouchers
  • Affiliates
  • Specials
  • Site Map
My Account
  • My Account
  • Order History
  • Returns
  • Wish List
  • Newsletter
All rights reserved Wittystore © 2014-2025, Company Reg.No. 544064 Ireland, VAT Registered
secure website