Calculators
Send and receive NC programs over RS-232
Send programs to the machine and receive them from it over a USB to RS-232 cable, from the browser, with XON/XOFF or RTS/CTS. The program goes straight from the browser to the port, not through a server.
This browser has no Web Serial API, so it cannot use a serial port. See which browsers support it on MDN or caniuse
Connection
Always check the machine's manual first. Machines of the same make and model may be set differently; read the actual values from the machine's I/O parameters. See where each make sets them.
Press Start receiving, then PUNCH at the machine
What you need
- A browser with the Web Serial API. If it is missing, a note shows above. Which browsers and versions support it changes over time; see the current table on MDN or caniuse. The page must be opened over HTTPS, and the browser asks which port to use each time you press Connect port.
- A USB to RS-232 cable, with the driver for its chip (such as FTDI or Prolific) installed. A built-in COM port works too.
- A correctly wired cable. The machine and the computer are both terminal equipment, so transmit and receive must be crossed (null modem), and RTS/CTS crossed too if used. The machine's connector may be DB25 or DB9. The RS-232 cable wiring reference (in Thai) has the pinouts and both cable types for a Fanuc DB25 port; for other machines, see the pinout in the machine's manual.
- Matching settings on both sides. Baud rate, data bits, parity, stop bits and flow control must match the machine's I/O parameters. The Common settings list gives common starting points only. Some makes, such as Mazak and some Mitsubishi models, set 8 bits on the machine while the computer uses 7 bits with even parity, because the controller counts the parity bit as a data bit.
Steps on a Fanuc-type controller
Sending a program to the machine
- At the machine, choose EDIT mode, press PROG, then (OPRT) READ and EXEC. The machine waits for data, with LSK flashing on the screen.
- On this page, open the file and press Send. The machine starts reading at the first % and stops at the second.
Receiving a program from the machine
- On this page, press Start receiving first.
- At the machine, choose EDIT mode, press PROG, select the program, then (OPRT) PUNCH and EXEC.
- When it has all arrived, save the file, or open it in the backplot to see the toolpath.
The key names and order differ between controller models; see the input/output section of the machine's operator manual.
Where to set it on the machine
This table is gathered from general sources, not your machine's manual. Parameter numbers and defaults differ between controller models and software versions. Check the machine's manual and read the actual values from the machine before choosing settings on this page, then send a short program of three or four lines before the real one.
| Controller | Where to set it | Notes |
|---|---|---|
| Fanuc 0i / 16i / 18i / 21i | Parameter 0020 selects the I/O channel. For channel 0: 0101 (bit 0 is the stop bits), 0102 (device type), 0103 (baud rate: 10 = 4800, 11 = 9600) | XON/XOFF is set on the computer. Other controller models use different parameter numbers. |
| Makino | Machines with a Fanuc controller are set in the Fanuc parameters | For Makino's own Professional controllers, see Makino's manual. |
| Haas | Settings 11 (baud rate), 12 (parity), 13 (stop bit), 14 (synchronization), 37 (data bits) | Defaults are even parity, 2 stop bits, 7 data bits. |
| Mitsubishi Meldas 60 | Parameters 9102 (baud rate), 9103 (stop bit), 9104 (parity check), 9105 (even parity), 9106 (data bits); the second device is 9202 to 9206 | Usually 9106 = 2 (7 bits), matching the computer. If sending fails or gives a parity error, try 9106 = 3 (8 bits) with the computer still at 7 bits and even parity, because some models count the parity bit as a data bit. |
| Mazak Mazatrol | The machine's data transfer (TAPE) parameter page | Set the machine to 8 bits and the computer to 7 bits with even parity. Older models (T2, T3) often use 4800. |
Flow control
- XON/XOFF: when the machine's receive buffer is nearly full it sends XOFF (DC3) to stop, and XON (DC1) when it is ready again. This page sends a few bytes at a time at no more than the baud rate, so it can stop as soon as the machine asks.
- RTS/CTS uses separate signal wires to say it is ready. The port driver handles it; the cable must have this pair wired.
- None works for short programs the machine can keep up with. If it cannot, set a delay after each line.
Common problems
| Symptom | Usual cause |
|---|---|
| The machine receives nothing | Transmit and receive are not crossed in the cable, the machine is set to another I/O channel, or RTS/CTS is used but the cable lacks that pair. |
| Garbage characters arrive | Baud rate, data bits or parity do not match. |
| The machine shows a parity or overrun alarm | Parity or stop bits do not match, or the two sides use different flow control. |
| The machine receives but never finishes | The file has no closing %. Fix the file, or keep Fix the file before sending on. |
| The port will not connect | Another program or tab has the port open, or the cable's driver is not installed. |
Sending while machining (DNC)
A program too long for the machine's memory can be fed in while the machine runs. The machine executes each line as it arrives and does not store the program. Put the machine in RMT (or DNC) mode, press Cycle start, then press Send; the machine receives and runs it line by line. This needs flow control.
- Keep this tab in front for the whole send, and do not let the computer sleep. Browsers slow a hidden tab down a lot, so data falls behind and the machine stops to wait part way. While sending, the screen is kept awake (if the browser allows), and the tab title shows the percentage sent. If you switch to another tab, a note tells you how long the tab was hidden when you come back.
- Warning when nothing goes out: if no data leaves the port for longer than the time set, the page shows a warning with likely causes, and the tab title changes to “⚠ Waiting” with the time, so you see it even from another tab. While machining, though, the machine may hold XOFF for a long time on a slow line, which is normal; set the time longer than the slowest line in the program.
- Closing or reloading the page while sending asks for confirmation first, because the send stops at once.
- Stop the machine at its panel first (Feed hold, then Reset), then press Stop sending. When data stops arriving, the machine waits at that line with the spindle still turning.
Limits
- ISO (ASCII) code only. The EIA code of older machines is not supported; set the machine to send ISO code.
- Every send and receive is started from the computer. Some DNC software lets the operator call programs from the machine's panel, the machine sending a request with the program number; this page does not.
- Plain text only, as with tape reading. Maker-specific protocols where both sides acknowledge, such as Heidenhain's LSV2, are not supported.
- A received file keeps only the program, from the first % to the second. Characters the machine sends in paper-tape style are removed: leading NULs that stand for blank tape, and the control codes DC1 to DC4. The parity bit (the 8th bit) is not read.
- Connection settings are remembered on this computer only. The last baud rate, data bits, parity, stop bits and flow control are saved in this browser and sent nowhere. From another computer or browser, or after clearing the browser's data, they return to the Fanuc defaults.