How to Change Program in a CNC Machine
Switching a program is the most repeated setup task on any shop floor, and the easiest one to get wrong. This guide shows how to change program in cnc machine controls without losing offsets or crashing a tool, from the edit sequence to the dry run checks. It is written for machinists and process engineers running Fanuc, Haas, Siemens or Heidenhain controls.

Key takeaways
What Changes When You Change Program in a CNC Machine
A program is only the motion list. Everything that connects that list to the physical part sits outside it: work offsets, tool offsets, cutter compensation registers, spindle warm-up state, and the fixture currently bolted to the table. When you change program in cnc machine memory, you are swapping the motion list and leaving all of that in place. That mismatch is where most crashes start.
Three situations look similar but are not. Loading a new program for a different part changes fixture, tools and offsets. Editing an existing program for a speed or feed tweak changes almost nothing physical, so a dry run alone is usually enough. Switching between operations inside one multi-step job, such as roughing to finishing, changes tools but keeps the same datum. Treat each one differently.
The controller brands differ in keystrokes, not in logic. Fanuc uses O-numbers and a MEM/EDIT switch. Haas puts program lists behind LIST PROG and uses a single MEM key. Siemens 840D calls them workpieces under the Program Manager, and Heidenhain stores .H files in its own file tree. Learn the logic once and the buttons take ten minutes per control.
Before you start, write down the current state. Program number, tool numbers in the carousel, work offset values for G54 through G59, and the Z reference position. If the new job is wrong, that note is your rollback. Shops that skip this step spend an hour re-datuming a vise they never had to move.
- 1Motion onlyThe program does not carry offsets, fixtures or tool data.
- 2Three casesNew part, edit in place, or operation switch inside one job.
- 3Same logicFanuc, Haas, Siemens and Heidenhain differ in keystrokes only.
- 4Write it downRecord program number, tools and offsets before you start.
Program Numbers, Memory Limits and File Transfer
Every controller has finite memory, and older Fanuc controls are the tightest. A 2 MB control fills fast when a job carries 40 tool paths. Before loading, check free space under the memory or directory screen and delete programs that finished more than a month ago. Keep the archive on the network or a USB stick, not on the machine.
Program numbers must be unique. If you load a file with an O-number already in memory, the controller overwrites the old one without a warning on most Fanuc builds. Adopt a numbering rule the whole shop follows: for example O followed by a four-digit job number and a two-digit revision, so O104207 is job 1042, revision 07. The rule costs nothing and prevents the worst kind of loss, which is a proven program replaced by a draft.
Transfer happens three ways. USB is fastest on modern controls and needs no network setup. DNC drip feed is still used when a program is larger than available memory, and it requires a clean RS-232 or Ethernet link plus a verified baud rate. Network transfer is best for shops with a program server, because file names stay readable and revision control is possible.
Check the file after transfer before you run it. Open the program in EDIT and read the first and last twenty blocks. The end of file matters most. A truncated final block leaves the machine waiting, and a missing M30 or M99 leaves it parked mid-cycle. If the last line is not the program end, transfer again.
- 1Check free memoryOld Fanuc controls fill at 2 MB. Delete finished jobs first.
- 2Unique O-numberA repeated number silently overwrites the existing file.
- 3USB, DNC, networkDrip feed only when the program exceeds memory.
- 4Read both endsVerify the first and last twenty blocks after transfer.
Offsets, Tools and the Data You Must Carry Over
Work offsets define where the part sits in machine coordinates. If the new job uses the same vise and the same datum corner, G54 may still be valid. If the part is longer, wider or flipped, every work offset value changes. Re-probe the datum instead of estimating. A 0.1 mm error in X becomes a scrapped face on the first pass.
Tool offsets are the second trap. The new program may call T07 as a 10 mm end mill while the carousel still holds a 12 mm drill at that station. Check the tool list against the pocket layout before cycle start. On lathes, the tool geometry and wear offsets decide the diameter, so a stale wear value of 0.05 mm moves the part size immediately.
Cutter compensation registers matter on milling jobs with profile passes. If the new program uses G41 with D21, register 21 must hold the actual radius of the tool in the spindle, not the last tool of that size. Registers survive program changes and are rarely checked. On a finishing pass at ±0.005 mm tolerance, a wrong radius register is a visible step on the part.
For first-article work, verify with a simple test. Bring the tool to the datum in MDI, read the absolute position, and compare it with the drawing. Two minutes of checking beats a wrecked fixture. After the first good part, record the offset values in the setup sheet so the next change program in cnc machine sequence starts from known numbers.
- 1Work offsetsSame vise and datum means G54 may hold. Any part change means re-probe.
- 2Tool offsetsMatch the program tool list against the physical pocket layout.
- 3Comp registersD21 must hold the real radius of the tool in the spindle.
- 4MDI checkRead absolute position at the datum before the first cut.
How to Change Program in a CNC Machine: 7 Steps
- 1Stop and record the current stateFinish the cycle, retract to the safe Z position, and stop the spindle. Write down the active program number, tool numbers in the carousel, G54 through G59 values, and the Z reference. This note is your rollback plan.
- 2Switch to EDIT or MEM modeTurn the mode selector to EDIT. Never load or delete a program in AUTO. On Haas, press the MEM key and then LIST PROG. On Siemens 840D, open the Program Manager. On Heidenhain, open the file tree. Confirm the cycle-start light is off.
- 3Manage memory before loadingOpen the directory screen and check free space. Delete finished jobs you no longer need. On a 2 MB Fanuc control, keep at least 200 KB free. Archive the deleted files to USB or the program server before you delete them.
- 4Load the new program and check the numberTransfer from USB, network or DNC. Confirm the O-number is unique and matches the setup sheet. Open the first and last twenty blocks and verify the final M30 or M99 is present. If the file looks truncated, transfer it again.
- 5Re-probe or verify work offsetsIf the fixture or part changed, re-probe the datum and update G54. If the setup is identical, read the existing values and confirm them against the drawing. Probe at a moderate feed, around 200 mm/min on most touch probes, to avoid a false trigger.
- 6Match tools to the program listCompare the program tool list with the physical carousel. Load missing tools and remove tools the new job does not use, so a stray T12 cannot be called by mistake. Update tool length and radius offsets for every tool in the new list.
- 7Dry run, then first articleRaise the work offset 50 mm in Z or use machine lock, run the program in single block at rapid override 25%, and watch the distance-to-go display. After a clean dry run, restore the offset, cut one part, and measure it fully before releasing the run.
When a Dry Run Is Enough and When It Is Not
Match the check level to the type of change.
| Type of change | What changed physically | Minimum check | Typical time |
|---|---|---|---|
| Feed or speed edit | Nothing | Dry run at reduced rapid | 2–5 min |
| New tool in same program | Tool list and offsets | Dry run plus tool offset check | 10–15 min |
| Operation switch in one job | Tool and comp registers | Single block first article | 15–30 min |
| New program, same fixture | Motion list only | Dry run plus datum verify | 20–30 min |
| New program, new fixture | Datum, tools, offsets | Full setup and first article | 1–3 h |
| Transferred over DNC | File integrity risk | Read both ends, then dry run | 20–40 min |
Frequently Asked Questions
Can I change program in cnc machine memory while the spindle is running?
No. Loading or deleting in AUTO mode can corrupt the active file or trigger an unintended move. Stop the cycle, retract to safe Z, stop the spindle, then switch to EDIT.
The only exception is a control with a dedicated background edit function, and even then the loaded program must not be the one currently executing.
What happens if two programs share the same O-number?
On most Fanuc builds the new file overwrites the old one without a prompt. The original is gone unless you archived it.
Use a shop-wide numbering rule with a job number and revision, and keep a copy on the server. It takes seconds and prevents losing a proven program.
Do offsets reset when I load a new program?
No. Work offsets, tool offsets and compensation registers live in the machine, not in the program. They stay exactly as the last job left them.
That is why the offset check matters more than the file transfer. A new program running on stale offsets is the most common cause of a first-part crash.
How do I handle a program larger than controller memory?
Use DNC drip feed over RS-232 or Ethernet. Set the baud rate to match both ends, typically 19200 or higher on modern controls, and confirm the handshake before starting.
Drip feed is more fragile than a stored program. Read the file end after transfer and keep the feed override low for the first pass.
Should I delete the old program after loading the new one?
Only after the new job has produced a good first article and you have archived the old file. Deleting early removes your fastest rollback path.
On tight-memory controls, delete the oldest finished jobs first rather than the one you just replaced.
How long does a program change take on a typical 3-axis mill?
A same-fixture program swap with verified offsets takes 20 to 30 minutes including the dry run. A new fixture with re-probing and a full first article runs 1 to 3 hours.
The variable is not the file transfer, which takes a minute. It is the datum and tool verification.
Need a Programmed Part Instead of a Setup Guide?
Send your CAD file and we will return a quote, a DFM analysis and a machining plan within 12 hours. We run 127 CNC machines across three plants, hold ±0.005 mm on production parts, and inspect 100% before shipment.
Quote within 12 hours±0.005 mm toleranceNo minimum order quantity