Also, RS 232 data transfer is real easy to understand and program, without difficult handshake rituals to go through. But sometimes you can still hit snags, like I did on Monday, when I wanted my student to start writing a program to controll our MKS Pressure controller. No luck, it just wouldn't answer. I checked syntax, the ports on both sides, the cable etc. all working, but no answer from the MKS. The next day I finally found the reason: MKS Instruments are a bunch of greedy bastards.
You see, in the RS 232 standard, two machines communicate with each other: The DTE (Data Terminal Equipment , normally the PC) and the peripheral device, called DCE (Data Communications Equipment, because originally it was mainly used for modems). The DE-9 connector (your typical COM-port) has nine pins, but in the simplest communication only three are used: pin 5 for ground, pin three for transmitted data (TxD) and pin two for received data (RxD). The other pins can be used for handshake protocols and to speed up data transfer, but since we are transmitting only a couple of characters (close valve, etc.) we don't need to bother with those.
Now who is transmitting and who is receiving? Both of course, because I can ask the pressure controller to report the current pressure to me. But in the standard it is specified that the DTE (PC) will transmit on pin three and receive on two, and the DCE will do it the other way round.
Now MKS Instruments (and they are in no way alone in this) thought: "Hey, we could make loads of money if we specify our controller as a DTE, so people will have to buy our "special" cable to use it with a PC! I bet nobody will figure that one out, and to make sure, let's hide this in a small footnote in the user's manual."
The cable you have to use to let two DTE's communicate with each other is no overprized "special" cable at all, it is called a crossed or Null-modem cable, older readers may remember it from way back when you would use it to let two PCs talk to each other. If you don't have one, you can make the cross by yourself with a solder iron and two sub-DE 9 connectors. So once I was getting desperate and sat down comparing the pinout in the Manual with the RS 232 specification, it took me about a minute to recognise the problem, and five minutes to solder up the solution:
And hey presto! it works. Take this, MKS! Take it with the day I wasted, and the bitterness of the tears my poor inconsolable student wept when he could not get his program to work.