11/18/2024
I was asked today to explain Fanuc RS-232C serial communications and handshaking - here is my response...
------
The RS232C serial protocol has 3 levels of handshaking – which almost all CNC Controllers support (especially Fanuc).
The first one to be needed is the DSR/DTS (CD) device select which tells us a cable (or device) is present. You know this as having to jumper 6,8,20 in the Fanuc DB-25F connector, or you get a "Carrier Detect Alarm".
The second handshaking method used is hardware flow control – CTS/RTS. The Fanuc has this "on" by default, and in older Fanuc controllers (Fanuc 6), this could be the only flow control needed. It works with the serial UART chip and can stop transmission of serial data in typically about 1.5 characters – so it is very fast – but not used as much anymore because the microprocessors of today are so fast. In many serial basic DNC applications, RTS and CTS (pins 4&5) are jumpered on the Fanuc DB25F side. However, if needed, I prefer to bring these lines out for safety – especially in high-speed DNC applications.
Finally, the most basic and common flow control is "software flow control" – using XON/XOFF – which almost every DNC system uses, including Fanuc. The benefit here is that one can use a minimum of serial lines (TX/RX/GND) and have files transferred. Also, Fanuc sends DC codes (DC2 (Punch On) and DC4 (Punch Off) when sending a file out and uses DC1 (XON) and DC3 (XOFF) when receiving a file.
The only catch is that Fanuc has a very limited 10-character read-ahead buffer – so after an XOFF, the sending computer must stop sending data quickly, or a “Buffer Overflow Error” will be seen on the control. As such, the use of USB-to-serial cables has been a real issue with DNC (since native DB9F serial ports on a computer are a thing of the past) - as the time to process an XOFF is too long due to the extra steps that the adapter adds to the process.
Our solution has been to make a dedicated ORiON Production Interface box (our OPI Unit) that easily handles this flow control. Shorter cables mean higher BAUD rates. The cables have 6,8,20 already jumpered, and we support hardware and software flow control. It is like a Fanuc file server inside the machine.
I might add that our Nexas OPI Unit supports the very useful M198 remote subprogram call that effectively means that the OPI unit is the memory of the machine – so gone are memory constraints, and one's part program files are easily loaded via network (LAN, Wifi, or even USB). It is an elegant solution…
Upgrading the memory in an older machine is possible, but for a little more money, it is possible to make it so that memory is never a constraint (right now, 7.4 gigs are available in the OPI for a user’s part programs). The M198 feature is free in most Fanuc controls and only must be configured correctly. We use the native Fanuc Floppy Cassette protocol as the serial device type in this case.