GreatLight CNC Machining Factory logo
CNC Machining
Rapid Prototyping
Materials
Industries
News
About GL

Get Instant Quote

CNC Programming Basics

What Program Does CNC Machines Use?

CNC machines run G-code, but that code is the last stop in a longer chain of software. This page explains each layer of that chain, from CAD model to spindle motion, so you can judge which workflow fits your part before you send it out.

G-code at the machineCAM generates toolpathsPost-processor bridges the twoControllers read the program
what program does cnc machines use
The short answer

What Program Does CNC Machines Use at the Spindle?

A CNC machine does not open a document the way a desktop computer does. It reads a program of coordinates, feed rates, spindle speeds, and switching commands, written in G-code and M-code. The controller parses each line and moves the axes. Nothing on the machine reads a STEP file directly.

So when someone asks what program does CNC machines use, the honest answer has two parts. The machine itself uses G-code. The shop uses a chain of CAD and CAM software to produce that G-code. Confusing the two is where most newcomers get stuck.

The chain matters because errors compound. A sloppy CAD model forces a messy CAM strategy, which produces inefficient toolpaths, which show up as chatter marks or a scrapped part. Fix the model early and the rest of the chain gets easier.

For simple 2.5D work, a programmer might still write G-code by hand at the control. For contoured surfaces, that approach is impractical. CAM software handles the math.

  • 1
    Machine languageG-code and M-code, read by the controller
  • 2
    Programming layerCAM software that outputs the G-code
  • 3
    Source dataCAD models in STEP, IGES, or native formats
Layer one

G-code Is the Only Language the Controller Understands

G-code is a list of motion commands. G00 moves at rapid speed, G01 moves at a programmed feed, G02 and G03 cut arcs. M-codes handle non-motion events: M03 starts the spindle, M08 turns on coolant, M30 ends the program. That is the whole vocabulary in its simplest form.

The controller on the machine interprets each block line by line. Fanuc, Siemens, Heidenhain, Mitsubishi, and Haas all read the same core G-code, but their dialects differ. A program written for a Fanuc control may need edits before a Heidenhain machine will accept it.

This is why post-processors exist. A post-processor takes the neutral toolpath from CAM and translates it into the dialect of your specific machine and control combination. Skip that step and you get alarms, not parts.

G-code is also where the machine's physical limits get encoded. Feed rates in mm/min, spindle speeds in rpm, tool change positions, safe Z heights. Get one of those wrong and the machine will happily crash into the vise.

  • 1
    G00 / G01Rapid positioning and linear feed moves
  • 2
    G02 / G03Clockwise and counterclockwise arc moves
  • 3
    M03 / M08Spindle on, coolant on
Layer two

CAM Software Turns Geometry into Toolpaths

CAM stands for computer-aided manufacturing. You import the CAD model, define the stock, pick tools, and set cutting parameters. The software then calculates the path the tool must follow to remove material without gouging the part or overloading the cutter.

The choice of CAM platform depends on part type. Mastercam and Fusion 360 dominate general milling and turning. PowerMill handles complex 5-axis impellers and molds. ESPRIT is common for mill-turn and high-volume turned parts. GibbsCAM and NX show up in aerospace and automotive work.

Good CAM output is not just about the shape. It is about tool engagement angles, chip thinning, and constant chip load. A toolpath that looks correct on screen can still chatter if the radial engagement is too high for the tool's flute count.

Software does not replace judgment. The programmer still decides whether to rough with a 16 mm end mill or a 50 mm face mill, whether to use high-feed or trochoidal paths, and where to leave stock for finishing.

  • 1
    2.5D workPockets, slots, drilled holes, simple profiles
  • 2
    3D surfacingContoured shapes, molds, organic geometry
  • 3
    5-axis simultaneousImpellers, blisks, complex aerospace parts
Layer three

The Post-Processor Bridges CAM and Machine

A post-processor is a configuration file, not a standalone program. It tells CAM how to format the output for a specific control: which G-codes to use, how to call tools, where to insert safe retracts, how to handle subprograms and macros.

Every machine and control pair needs its own post. A Haas VF-2 with a Haas control uses a different post than the same machine with a Fanuc retrofit. Shops that run mixed equipment maintain a library of posts and update them when machines are added or replaced.

A bad post is expensive. It can produce code that runs correctly but slowly, adding minutes per cycle. Or it can produce code that looks right until the tool plunges into the fixture. Most shops test a new post on a scrap block before trusting it on a real job.

Post-processors are also where shop standards live. Safe Z heights, coolant defaults, tool numbering schemes, and program header comments all come from the post. Standardizing posts across a shop reduces setup errors.

  • 1
    Control-specificFanuc, Siemens, Heidenhain, Haas dialects
  • 2
    Machine-specificTravel limits, tool changer positions
  • 3
    Shop-specificSafety defaults, naming conventions
Layer four

CAD Formats and What the Shop Can Actually Read

CAD software creates the model; CAM software consumes it. STEP and IGES are the neutral exchange formats that almost every package can read. Native formats like SolidWorks SLDPRT, Fusion F3D, or Creo PRT work if the shop runs the same software.

For machining, STEP AP214 or AP242 is usually the safest choice. It carries solid geometry and assemblies cleanly. IGES is older and can produce surface gaps that force repair work. STL is a mesh format, fine for 3D printing but poor for CNC because it loses precise curves.

The model should be the final, manufacturable geometry, not a concept sketch. Include tolerances, surface finish callouts, and thread specifications on the drawing. If critical features are only in the 3D model and not dimensioned, the programmer has to guess.

Send the drawing and the model together. The model defines the shape; the drawing defines what matters. When the two disagree, we ask before cutting.

  • 1
    STEP AP214/AP242Best general choice for CNC
  • 2
    IGESOlder, watch for surface gaps
  • 3
    STLMesh only, avoid for machined parts
Layer five

Why the Program Choice Changes the Part

The program determines more than the shape. It sets the surface finish, the cycle time, and the tool life. A roughing strategy that takes deep, light cuts may finish faster than a conservative one that takes shallow, heavy cuts, depending on the material.

Aluminium 6061 and 7075 behave differently. The same toolpath that runs clean in 6061 can chatter in 7075 because of its higher strength. Titanium Ti-6Al-4V and Inconel need lower surface speeds and more coolant, and the CAM parameters must reflect that.

Tolerance also drives programming decisions. Holding ±0.005 mm on a bore may require a separate finishing pass with a boring head, not just an end mill. The program has to include that pass, with the right feed and speed.

This is why we ask about function, not just geometry. A bracket that carries load needs different programming than a cover plate that only looks good. Same shape, different program, different result.

  • 1
    MaterialAluminium, steel, titanium, plastics
  • 2
    ToleranceGeneral machining vs. tight fits
  • 3
    FunctionLoad-bearing vs. cosmetic
In the shop

How GreatLight Handles Programming Workflows

We run 127 high-precision CNC machines across three wholly-owned plants, including 16 simultaneous 5-axis machining centers, 12 four-axis mills, 27 three-axis machines, and 16 mill-turn centers. Maximum processing size reaches 4,000 mm.

That mix means we maintain posts and expertise across several CAM platforms. A complex 5-axis impeller and a high-volume turned fitting do not go through the same software, and they should not.

Every job gets a DFM review before programming starts. We check wall thickness, tool reach, and whether the tolerance is achievable with the chosen process. Quotation and free DFM analysis come back within 12 hours.

We hold ISO 9001:2015, IATF 16949:2016, ISO 13485:2016, and ISO 27001:2022. Uploads are secure and confidential, and an NDA is available on request. No minimum order quantity, from one prototype to 10,000+ part runs.

  • 1
    Tolerance±0.005 mm (±0.0002 in) on precision work
  • 2
    FinishRa 0.2–0.8 μm fine, Ra 0.8–1.6 μm high
  • 3
    Inspection100% before shipment, reports on request
When to use what

Workflow Choices by Part Type

The right programming approach depends on geometry, tolerance, and volume.

Part typeBest workflowWhyWatch out for
Simple 2.5D plateHand-written G-code or basic CAMFast to program, easy to verifyTool wear on long runs
3D contoured surfaceCAM with 3-axis surfacingManual math is impracticalLong cycle times
5-axis impellerCAM with simultaneous 5-axisTool access and collision controlPost-processor errors
Turned fitting, high volumeCAM for mill-turn or latheConsistent cycle timeBar feeder setup
Tight-tolerance boreCAM plus boring head passEnd mill cannot hold ±0.005 mmThermal growth
Prototype, one-offCAM with conservative feedsAvoid scrap, not cycle timeStock availability

Pick the Workflow, Not the Brand

If your part is simple 2.5D and the volume is low, hand-written G-code or basic CAM is enough. If it has contoured surfaces, tight tolerances, or 5-axis features, you need a shop with the right CAM platform and a post-processor proven on that machine. The software name matters less than whether the shop has run your part type before.

FAQs

Common Questions

Do CNC machines run on Windows?

Some controllers run on an embedded Windows or Linux base, but the machine itself does not run Windows applications. The operating system hosts the control software, which reads G-code.

You cannot open a STEP file on the machine and expect it to cut. The file has to go through CAM first.

Can a CNC machine run a program from a USB stick?

Yes. Most controllers accept programs via USB, network, or direct memory. The file is still G-code, not a CAD model.

Large programs may exceed the controller's memory, so shops use drip feeding or run from a network drive.

What is the difference between G-code and M-code?

G-code controls motion: rapid moves, feeds, arcs, and coordinate systems. M-code controls machine functions: spindle on and off, coolant, tool changes, and program end.

Both appear in the same program. A typical block might contain a G01 move followed by an M08 coolant command.

Do all CNC machines use the same G-code?

The core commands are similar, but dialects differ between Fanuc, Siemens, Heidenhain, Haas, and others. A post-processor adapts the output to the specific control.

Sending a program written for one control to a different machine often triggers alarms or unexpected motion.

Can I program a CNC machine without CAM software?

For simple 2.5D parts, yes. Many programmers write G-code by hand for drilling, facing, and simple pockets.

For contoured 3D surfaces or 5-axis work, manual programming is not practical. The math for tool compensation and collision avoidance is too complex.

What file should I send for a CNC quote?

Send a STEP AP214 or AP242 file plus a 2D drawing with tolerances, finish callouts, and thread specs. Include material and quantity.

If you only have a native CAD file, send that. We can read most major formats or convert them.

Send Your Model, Get a Program Plan

Upload your CAD file and drawing. We review manufacturability, pick the right CAM workflow, and return a quote with DFM feedback within 12 hours.

12-hour quote100% inspectionNo minimum order quantity

Follow our work

More CNC Programming Insights

We publish setup notes, tooling trials and inspection data from the factory floor.

FacebookTikTokYouTubeLinkedInInstagramThreadsPinterest

Trusted by engineers and manufacturers worldwide

Tesla Ford Motor Company BYD Auto Denso Magna International Boeing Airbus Medtronic KUKA FANUC