How to Send a Program to a CNC Machine
This guide covers the transfer routes we use every day: USB, network DNC, and drip feeding. You will see what each one needs, the file checks that come first, and the mistakes that scrap parts. Written for programmers and setup operators who have to get code into a controller today.

Key takeaways
What sending a program to a CNC machine actually involves
A CNC program is a plain text file. It holds G-code and M-code: tool changes, spindle speeds, feed rates, coolant commands, and the coordinates that drive each axis. The CAM system writes it, a post processor formats it for the specific control, and then it has to reach the machine. That last step is what this page is about.
To send a program to a CNC machine, three things must line up: the file format the control accepts, the physical or network path between the PC and the controller, and the controller being ready to receive. Miss any one of them and you get an alarm, a partial file, or a silent truncation that only shows up when the tool plunges into the wrong place.
File size decides the route more often than anything else. Fanuc 0i controls commonly have 128 KB to 512 KB of program memory, while a large 5-axis surfacing path can run past 20 MB. If the file fits, you copy it in and run from memory. If it does not, the control has to read the code line by line from an external source while the machine cuts. That is drip feeding, and it changes how you set up the job.
It helps to think in three layers. The file itself: name, extension, line endings, and whether the post output matches the control. The transport: USB, CF card, RS-232 serial, Ethernet, or a DNC server. The receiving end: program number, memory space, receive mode, and the work offset that the code assumes. We check all three before a spindle ever turns.
- 1File layerExtension, program number, correct post processor for the control
- 2Transport layerUSB, CF, RS-232 with handshake, or Ethernet/DNC
- 3Control layerReceive mode, free memory, active work offset, tool table
Prepare the file and the machine first
Most transfer failures start long before the cable. Open the file in a plain text editor and look at the header. You want a percent sign or a program number on the first line, a safe start block that clears offsets and cancels compensation, and a defined work offset such as G54. If the CAM output starts straight into G1 moves with no safe block, fix the post processor before you fix the cable.
Line endings matter more than people expect. Windows uses carriage return plus line feed; older controls accept that, but some will stall on a lone line feed from a Linux or Mac export. A file that stops partway with a buffer alarm is often a line-ending problem, not a memory problem. Re-save as plain ASCII, not UTF-8 with a byte order mark.
Check that the program number is not already in memory. Overwriting a proven program on the shop floor is a real risk, and so is calling the wrong one at the machine. Give each revision a distinct number and write the revision in a comment line near the top. When an operator presses cycle start at 6 a.m., the program number on the screen has to match the drawing revision on the bench.
Then the machine side. Confirm there is enough free memory, the control is not in a locked or edit-protected state, and the correct work offset is active. On a mill-turn or 5-axis machine, also confirm the rotary zero and the tool length offsets the program expects. Transfer goes smoothly when the receiving end is already set up.
- 1Header checkPercent sign, program number, safe start block, G54 or equivalent
- 2EncodingPlain ASCII, no byte order mark, consistent line endings
- 3NumberingUnique program number per revision, revision noted in a comment
Choose the transfer method that fits the machine
USB and CF cards are the default in most job shops. You copy the file to a FAT32-formatted stick, plug it into the control, and either run from the card or copy it into memory. It is fast, it needs no cabling, and it works on machines with no network port. The catch is discipline: sticks move between machines and offices, and it is easy to run last month's revision.
RS-232 serial DNC still runs on plenty of older mills and lathes. You need the right baud rate, matching on both ends, usually 9600 or 19200, plus correct handshake settings such as XON/XOFF or hardware flow control. Cable pinout is the usual culprit. A null modem cable is not the same as a straight-through cable, and a 25-pin to 9-pin adapter wired for the wrong pinout will just sit there while the control waits for data.
Ethernet and DNC servers are the cleanest option once configured. The controller pulls or receives files over the network, and the DNC software tracks versions centrally. Setup takes an afternoon of network configuration, but after that you stop walking sticks around the shop. For high-mix work with frequent revisions, this is worth the effort.
Drip feeding is the fourth route, and it is not a casual choice. The control reads the program from a PC or card while cutting. If the link hiccups, the machine stops mid-cut, and on a deep pocket that can mean a scrapped part. Use it for large surfacing paths, keep the PC dedicated to that machine, and never run other software on it during a cut.
At GreatLight we run 127 high-precision CNC machines across three wholly-owned plants, including 16 simultaneous 5-axis machining centers, and the transfer route is chosen per job. Small prismatic parts run from memory. Large aerospace and mold work goes over the network or drip feed. The route follows the file and the machine, not a house preference.
- 1USB or CFFastest for files that fit in memory; watch revision control
- 2RS-232 DNCNeeded on older controls; verify pinout, baud rate, handshake
- 3Ethernet / DNC serverCentral version control; one-time configuration cost
- 4Drip feedFor files larger than control memory; dedicated PC, no multitasking
Step by step: how to send a program to a CNC machine over USB
The same sequence applies to network transfer, with the copy step replaced by a network send.
- 1Confirm the drawing revision and program numberMatch the program number in the header to the revision on the traveler. Do not skip this for a repeat job; that is exactly when the wrong file gets loaded.
- 2Format the USB stick as FAT32Most Fanuc, Siemens, and Heidenhain controls read FAT32 reliably and struggle with exFAT or NTFS. Keep one stick per machine family if you can.
- 3Copy the file with the correct extensionUse .nc, .tap, or the extension your control expects. Rename .txt or .mpf files only if the control documentation allows it. Never edit the code in a word processor.
- 4Set the control to receive or select the fileOn the control, enter edit or program mode, open the card or USB directory, and select the file. If you are copying into memory, choose a free program number first.
- 5Copy into memory or prepare to run from the cardFor files under roughly 1 MB, copy into memory and run from there. Larger files stay on the card or drip feed, depending on what the control supports.
- 6Verify the first and last blocks on screenScroll through the header and the tail of the program on the control display. Confirm the safe start block, the work offset, and the M30 or M99 at the end.
- 7Set offsets and run a dry runLoad the tool length and work offsets. Run with rapid override down and single block on, or use the control's dry run and toolpath graphics, and watch the distance-to-go display.
- 8Cut the first part with feed override lowStart at 25 to 50 percent feed override with rapid override reduced. Bring it up once the first pocket or profile is cutting cleanly.
Transfer methods compared
Pick by file size, control age, and how often the revision changes.
| Method | Best for | Setup effort | Main risk |
|---|---|---|---|
| USB or CF card | Files under 1 MB, machines with no network | Low | Running an outdated revision |
| RS-232 serial DNC | Older controls with a 9-pin or 25-pin port | Medium: cable and baud rate | Wrong pinout or handshake setting |
| Ethernet / DNC server | High-mix shops with frequent revisions | High: one-time network setup | Network drop mid-transfer |
| Drip feed | Files larger than control memory | Medium: dedicated PC per machine | Link stall mid-cut scraps the part |
| Manual entry (MDI) | Short setup moves and single operations | Low | Typing errors in coordinates |
The short version
Match the transfer route to the file size and the control, verify the header and the offsets at the machine, and run the first part slow. That sequence prevents almost every transfer-related scrap event we see.
Common questions about program transfer
Why does my control say buffer overflow when I send the program?
Buffer overflow almost always means the PC is sending faster than the control can read, or the handshake is not working. Lower the baud rate one step, for example from 19200 to 9600, and confirm both ends use the same flow control setting.
Check the cable pinout as well. A cable wired for hardware handshake on one end and XON/XOFF on the other will produce exactly this alarm. If the file is very large, drip feed software with proper flow control is more reliable than a plain terminal send.
Can I send a program while the machine is cutting?
On most controls, no. The control is either in run mode or in receive mode, not both. Trying to load a program into memory during a cut usually triggers an alarm or a mode conflict.
The exception is drip feeding, where the control reads from an external source as part of the run. Even then, the PC must be dedicated to that machine and doing nothing else.
What file format does a CNC machine read?
Plain ASCII text containing G-code and M-code. Extensions vary by control: .nc, .tap, .h, .mpf, .prg, and .iso all appear in the field. The extension matters less than the content and the line endings.
Never send a binary CAD file such as STEP, IGES, or STL to a control. Those have to go through CAM and a post processor first. DXF files are for the CAM system, not the machine.
How do I stop operators running the wrong revision?
Put the revision in the program number or in a comment on the first lines, and keep one program number per revision rather than overwriting. Many shops also keep a paper traveler with the revision printed on it.
Central DNC software helps because the server controls which file is released to which machine. It is not a substitute for the operator checking the number on the screen before cycle start.
Does drip feeding affect surface finish?
Not by itself. The machine moves at the commanded feed regardless of where the code comes from, as long as the link keeps up. Problems appear when the link stalls and the control has to pause.
Keep the drip feed PC free of other tasks, use a shielded cable or a stable network link, and keep the baud rate well within what the control handles. On fine finishing passes at Ra 0.8–1.6 μm, a stall leaves a visible mark.
Can you handle the programming and transfer for my parts?
Yes. We quote and provide free DFM analysis within 12 hours, and production can start within 24 hours. Parts ship in 3–5 days for most jobs, with 100% inspection before shipment and reports on request.
Uploads are secure and confidential, and an NDA is available on request. We hold ISO 9001:2015, IATF 16949:2016, ISO 13485:2016, and ISO 27001:2022, and we machine to ±0.005 mm on parts up to 4,000 mm.
Send us the drawing, we handle the rest
Upload your files and get a quotation with free DFM analysis within 12 hours. Program transfer, offsets, and first-article checks are part of the job, not an extra.
12-hour quote100% inspectionNDA on request