RS232 Communications parameters & cable wiring setups

Thread Starter

cncguy

Joined May 13, 2009
2
I have used RS232 Communications for CNC machinery for many years. However have not been able to find any good information on the different cable setups used as well as an understanding of DC1-DC4 codes and such. I am usually able to get things to work after trial and error, but would like some documentation on the subject. I am also looking for information on the different handshaking protocals and what is required for the cable pinouts. I have purchased cables in the past which sometimes work for a specific machine and not others so many times I have had multiple cables. Some will wait for the machine to be ready and some will not. The best combination I have found is to buy a null modem, DB9pin to DB25 adapter and a DB9pin 10ft cable. If I purchase as one unit it seems to funciton differently. I know I asked a lot of questions but they are all somewhat related.

Thanks
 

davebee

Joined Oct 22, 2008
540
If you've gotten enough experience connecting RS232 devices that you've accumulated all those adapters, then I think you probably know as much as anyone about the different cable setups one might find in the field.

I've seen so many variations of 9 vs. 25 pins, DTE vs. DCE pin configuration, male vs. female connectors, TTL voltage level vs. true RS232 voltage level, hardware vs. software vs. no handshaking that I think it would be hard to say anything general about how RS232 is configured.

Ideally, given any two machines, you'd read the documentation on exactly how to configure the communication link. In practice, when it's common to be handed two machines and maybe some cabling with little or no documentation, I wouldn't know what to suggest other than what you seem to have already learned - you try different settings until the link works.

It can be helpful to get one of those little boxes with LEDs that show the status of each line.
 

russ_hensel

Joined Jan 11, 2009
825
RS232 is not much of a standard, it is more a collection of different standards where each device chooses which of the set it chooses to implement, wiring, speed, parity, flow control are at the low level, at a higher level is the protocol which the rs232 implements, which comes in even more flavors.
 

AlexR

Joined Jan 16, 2008
732
RS232 is not much of a standard, it is more a collection of different standards where each device chooses which of the set it chooses to implement, wiring, speed, parity, flow control are at the low level, at a higher level is the protocol which the rs232 implements, which comes in even more flavors.
I beg to differ but RS232 or to be precise EIA232 most certainly is a standard. It defines the connector types, signal levels and functions and pin designations that will be used.

Unfortunately some sections of industry (notably the computer industry) have modified and adapted the standards to suit own needs but retained the RS232 name even though the modified form no longer conforms to the standard.

A further complication arises because the RS232 standard defines two forms of interface, a DCE and a DTE. To connect a DCE to DTE requires a straight through cable where as to connect a DTE to DTE requires a cross-over cable and to connect a DCE to DCE needs yet another configuration of cross-over cable.
 

DonQ

Joined May 6, 2009
321
I worked for a while at a company that made PLC and CNC control sytems for industry. When I first started there, the story was the same as it is at many places. There was a box full of cables, each with a label on it to say what machines it would hook together. Every time a new combination of machines was needed, some poor smuck got to spend an hour or two figuring out something that would work and soldering up a new cable.

Really fast, I got tired of never being able to find the right cable, or using the one labeled for my task, and finding that it wouldn't handshake, or some other problem. Everyone told me that was just the way it was with RS232.

Nonsense!

After a bit of work with a breakout box, I found that there was a combination that worked on almost half of the combinations. It was a 25-pin straight through cable! Adding two gender changers let me only have to have one cable to connect everything that would work with a straight through cable.

The other half had the send/receive swapped, so all the handshake lines needed to be swapped also. There isn't a direct pin to pin swap for the handskake lines, but here is what I found that worked on almost all the remaining equipment


Rich (BB code):
2-------3
3-------2
4-------5
5-------4
7-------7
6-+----20
  |
8-+

20----+-6
      |
      +-8
and pin #1 should be grounded at one end only (shield)
In the end I wound up with a length of 25 conductor ribbon cable with 25-pin opposite sex d-shell connectors on either end (used just as an "extension cord"). I had two gender changers (male-male and female-female). The kit was completed with one 25-pin male-female converter like described above.

With these few parts, I could connect, with handshaking (when implemented), to all 25-pin systems except for one that I can remember (more about this in a second).

There were a few other systems, like a Modicon, that needed an alternate connector (a cannon connector in this case). For this I made a cannon to 25-pin D-shell pigtail about 6" long. Now, with my "extension cord", gender changers and polarity converter, I could hook it to virtually anything. This kit took the place of at least 10 different cables in the box for the Modicon alone.



The one that didn't work was a Gidding&Lewis controller, where they decided to do something totally original with the front-panel serial connector. Programming worked, but communicating with the ladder-logic program while it was running used a totally non-standard way of toggling the handshake line. I finally found a PC bit-twiddling way to send at more than the 300-600baud that G&L said I had to slow down to, but it was really non-standard, and not RS232!



More recently, I had to add 25 to 9-pin adapters to keep working with my previous kit. I've now replicated the whole system in 9-pin, including a 50' "extension cord". I don't know the pins by memory, so just use a standard chart of a straight conversion of the pins from 25 to 9. You wind up with one pin not connected (I think it is pin 9, "ring").

With a voltmeter or cheap breakout box to see which lines are hot on the two ends (Measure pins 2 and 3 to the ground pin, the send pin is hot, the receive pin is open). Then I can pull out a couple adapters and get almost every system communicating properly in just a few moments.

Once I know what it needs, I can make a permanent installation and wrap up my kit.

OK, before everyone tells me how wrong I am... realize I said almost!

Out of literally hundreds of 9 & 25 pin serial lines I've used, all except a couple of them worked with this kit. There will still be a very occasional system where this doesn't work. At that point you do not say that RS232 is not a standard. What you say is that despite the standard, when someone who doesn't have a clue decides to make something with a serial port (ahhh-choo_G&L!), they are free to hook up the wires to the back side of the D-connector any way they want. These are anybodies guess. These are also not RS232! Fortunately, they are fairly rare.

Most likely, the freestyle problems will be with the handshake lines not being used the way that 99.9% of the other systems use it. Depending on the importance, and if it sends at all, you can just send really slow in a pinch. If it doesn't send at all, or it will need to go fast, you'll just have to get a breakout box and start earning your keep.
 
Top