How to Transfer a Program to a CNC Machine
Five ways to transfer program to CNC machine controls, the settings each one needs, and how to tell which route your machine actually supports. Written for machinists and process engineers running 3-axis mills, mill-turn centers and 5-axis machines.

In this article
- 1
- 2
- 3
- 4
- 5
- 6
Key takeaways
Check what your control can accept before you transfer program to CNC machine memory
Start at the nameplate, not at the computer. Write down the control family (Fanuc 0i, 31i, Siemens 828D, Heidenhain TNC 640, Mitsubishi M80) and the year of build. That single line tells you which ports exist, which file extensions the control will read, and how much internal memory you can fill before the machine refuses the load.
Then count your program size. A simple 3-axis profile with 40 tools and 12,000 blocks in 2D paths is often 300 KB to 900 KB. A 5-axis impeller toolpath with 400,000 blocks can pass 8 MB. Size decides the route: anything that fits in control memory should be copied in and run from RAM, because a running cut cannot be interrupted by a loose cable or a sleeping laptop.
Check the ports while the cabinet door is open. USB type-A on the pendant or inside the cabinet, a CompactFlash slot, an RJ45 Ethernet jack, and a 9-pin or 25-pin D-sub for RS-232. Some older machines only have the D-sub, which forces drip feed for anything large.
One more thing to record: the control's maximum file name length and whether it accepts lowercase. Fanuc generally wants 8 characters or fewer with a letter first and an extension such as .NC or .TXT. Renaming a file before you transfer it costs ten seconds and saves a service call.
- 1Write the control familyIt decides extensions, memory limit and which ports exist.
- 2Measure the program sizeUnder 1 MB fits memory; over 2 MB needs drip feed.
- 3Photograph the portsUSB, CF, RJ45, D-sub. Note which are live.
- 4Note the naming rulesShort names, letter first, .NC or .TXT.
Best practices so the transfer program to CNC machine step never fails
Always post-process for the exact control you are loading. A file posted for a Fanuc with G43 H offsets will alarm on a Siemens control that expects different tool length syntax. Keep one post per machine and label the folder with the machine name, not the operator name.
Transfer in Edit mode or MDI, never in Auto or during a cycle. The control protects the program directory while the buffer is active, and a failed write can leave a half file behind. If a transfer is interrupted, delete the partial file before retrying.
After loading, compare the first ten and last ten blocks on screen against the office copy. The last blocks matter most: M30 ends the program, M99 loops it, and a missing M30 makes the machine look frozen when the program simply never ends.
Keep the tool offsets, work offsets and program in the same job folder. When a program arrives without its offset sheet, the operator retypes numbers, and that is where most dimensional errors start.
Back up control memory monthly to a PC or server. Memory batteries fail, and a control that loses its parameters also loses the programs stored on it.
- 1One post per machineLabel posts by machine, not by operator.
- 2Transfer in Edit or MDINever while the buffer is active.
- 3Check first and last blocksM30 missing is a common false alarm.
- 4Ship offsets with the programRetyped numbers cause scrap.
When the control will not read the file
The first check is the file itself. Open it in the editor and confirm the first block is a safe start, usually G21 or G20 plus G40 G49 G80, and the last block is M30. A file that begins mid-toolpath or ends with M99 will run in an unexpected place.
The second check is format. Some controls reject CRLF line endings or a byte order mark. Save as plain ASCII, not UTF-8 with BOM, and keep the extension in the accepted list. A .NC file renamed to .TXT sometimes loads when .NC does not.
The third check is the medium. A USB stick that worked yesterday may have a failing controller. Try a second stick formatted the same way. On serial links, swap the cable before touching the control parameters, and verify XON/XOFF against the PC software settings.
If the file loads but the machine alarms on cycle start, the problem is usually the program header or an offset, not the transfer. Read the alarm number, clear it, and check the active work offset and tool number against the setup sheet before pushing cycle start again.
- 1Read the alarm numberIt points to the header, an offset or a limit.
- 2Try a second USB stickFailed controllers are common and cheap to rule out.
- 3Swap the serial cable firstChange parameters last.
- 4Confirm the active offsetG54 versus G55 is a classic scrap cause.
How to transfer program to CNC machine: five methods, step by step
Pick the route that matches your file size and control age.
- 1USB flash driveFormat the stick as FAT32 with 4 KB clusters, 32 GB or smaller. Create a folder named after the job, no spaces. Save G-code as .NC or .TXT. Insert it with the control in MDI or Edit mode, never in Auto. Press the USB or MEM key, page to the file, then Read or Copy to load it into control memory. Pull the stick only after the copy prompt clears. Common error: USB 3.0 sticks over 64 GB, exFAT formatting, or a stick left in during a cut.
- 2Direct copy to control memoryOn the control, open the Program directory and check free space before copying. Fanuc shows it on the memory screen; Siemens shows it under Program manager. Keep 20 percent free so the control can buffer the cut. Select the file, press Copy, and confirm the destination is the user directory, not a sub-program folder. Run a dry run at rapid override 25 percent and single block before the first real pass.
- 3Ethernet or Wi-Fi with FTPSet a fixed IP on the machine, for example 192.168.1.50 with mask 255.255.255.0 and gateway 192.168.1.1, then set the PC to the same subnet. On the PC, open an FTP client or map a network drive, log in with the control's user name, and drop the file into the machine's program folder. Typical values on Fanuc are port 21, user name and password set under Embedded Ethernet. Keep the cable run under 100 m and away from spindle drive cables.
- 4CompactFlash or memory cardA CF card in a PCMCIA adapter behaves like a small hard disk on older Fanuc and Mitsubishi controls. Format it to FAT16 if the control is pre-2010, then copy files with a card reader on the PC. Set the control's parameter to read from the card, load to memory, and remove the card before cutting. Leaving the card in place risks a read error mid-cycle.
- 5RS-232 serial, including drip feedMatch both ends: 9600 or 19200 baud, 7 data bits, even parity, 2 stop bits, XON/XOFF flow control. Use a null modem or the correct handshake cable, not a straight-through one. For files larger than control memory, switch the machine to DNC or TAPE mode and start the send from the PC first, then cycle start. Drip feed at 9600 baud feeds roughly 100 characters per second, which is enough for fine 3-axis contouring but not for dense 5-axis paths.
- 6Cloud upload to a shop serverPost the post-processed file to a shared drive or shop server, then pull it at the machine over the same network path. Keep one master copy per revision and lock the file after transfer. This removes the walk to the office and the wrong-revision risk on multi-shift jobs.
Which transfer route fits which job
| Route | Best for | Watch out for |
|---|---|---|
| USB flash drive | Standalone machines, files under 2 MB | Sticks over 64 GB or exFAT |
| Control memory copy | Repeat jobs, small 3-axis parts | Memory fills up; keep 20% free |
| Ethernet / FTP | Batch runs, multi-machine cells | Wrong subnet or firewall on the PC |
| CompactFlash card | Older Fanuc and Mitsubishi controls | FAT16 needed on pre-2010 controls |
| RS-232 drip feed | Files over control memory, legacy machines | Baud too low for dense 5-axis paths |
| Cloud to shop server | Multi-shift shops, revision control | Unlocked files get overwritten |
Pick the route, then lock the revision
If the file fits control memory, copy it in and run from RAM. If it does not, drip feed over Ethernet or serial. Either way, one master file per revision and a check of the first and last blocks before cycle start.
Frequently asked questions
What file format do most CNC controls read?
Plain ASCII G-code with a .NC, .TXT or .H extension is the safest choice. Fanuc and Mitsubishi controls generally want short names with a letter first. Binary or CAM-native formats need a post processor first.
How large a program can I load from a USB stick?
The stick size is rarely the limit; control memory is. Many 3-axis controls hold 1 MB to 2 MB of programs, so anything larger runs better as a drip feed. A 5-axis toolpath can pass 8 MB, which is well past most control memory.
Why does the machine say the program is empty after transfer?
Usually the file landed in the wrong directory, the extension was not recognized, or the copy was interrupted. Check the destination directory, confirm the extension, and delete any partial file before retrying.
Can I drip feed a 5-axis program over RS-232?
It works only if the block density stays inside the available baud rate. At 9600 baud the link feeds roughly 100 characters per second, which is tight for dense 5-axis paths. Ethernet or control memory is the safer route.
Do I need to change the post processor for each machine?
Yes. Tool length syntax, work offset calls and canned cycles differ between control families. One post per machine keeps the transfer step boring, which is what you want.
How do you handle program transfer on production parts?
Files are posted per machine, transferred over a controlled network path, and checked against the setup sheet before the first cut. GreatLight runs 127 high-precision CNC machines across three plants, so one transfer standard keeps every cell consistent.
Send the file, get a manufacturability check back
Upload your CAD and we return a quotation with free DFM analysis within 12 hours. Uploads are secure and confidential, and an NDA is available on request.
Quotation in 12 hours±0.005 mm toleranceNo minimum order quantity