RS232 comm experts?

Mike_H

autos are better - WRWD508
Original poster
Supporting Member
Joined
Feb 28, 2017
Messages
12,942
Location
Grand Rapids, MI, United States
Do we have any here? I have an old CNC that uses rs232 to communicate with with a PC for program storage. Low and behold my employees let the cable get so bad that three of the 7 wires broke off.

It seems like a standard 9 pin to 25 pin null modem, so that's how we wired it. I'm not getting a transfer. So... How do I debug this to make sure my cable is correct?

Thanks!
 
I haven't touched that in years but I've dealt allot with RS-232 and 422 quite a bit. First step is just to check pins versus this

https://en.wikipedia.org/wiki/RS-232#Pinouts
it can definitely just work with three wires, RX, TX and ground. Even two wires for one direction. It just depends on how much handshaking they are using. You can check the DTR, DSR and all those ready to send and receive signals with a voltmeter. For the two data wires it helps to have an oscilloscope. Checking the cable is a good start.
 
Oh man - I've soldered a gazillion of those things for dumb terminals back in the day. But, it's been about 40 years so I would not trust my recollection on the pinouts....

...and boy does that make me sound old.
 
Ah, the RS-232 interface blues. If they originally used the handshake lines, you'll need to continue to do so. Otherwise the PC may be looking for CTS/RTS forever, or the CNC will be overrun because the PC doesn't stop.

MOST LIKELY an off the shelf cable will work with the the necessary adapters. But certainly not guaranteed. The one thing IBM did correctly was their RS-232 ports, if the CNC was built after about 1985, it "should" just plug in. But you're telling me it has a 25 pin port, which could mean anything. A volt meter/scope is your friend...
 
Oh man - I've soldered a gazillion of those things for dumb terminals back in the day. But, it's been about 40 years so I would not trust my recollection on the pinouts....

...and boy does that make me sound old.
The pin outs are relatively easy to find. It's the voltage that I'm questioning. I'm getting a low signal on one of my data pins... Which I didn't expect.
 
Below zero is required for it to signal low, that's how it works.

Edit: The page I linked to has the signal voltage levels, they are very flexible. Most RS-232 can use TTL but that is definitely not how it's supposed to work.
 
  • Like
Reactions: Zorba
Below zero is required for it to signal low, that's how it works.

Edit: The page I linked to has the signal voltage levels, they are very flexible. Most RS-232 can use TTL but that is definitely not how it's supposed to work.
Yea - that's the on-going problem with RS-232. Bastardized-232 has been the bane of my existence my entire career. TTL level, or 12v and ground, and even a pseudo 422 style network done with a 232 port. Shitty hookups don't help either - an entire building had 2 wire 232 running all over the place with no ground wire. Building ground was referenced instead. It worked - kinda - until it didn't. *blech*
 
  • Like
Reactions: pagrey
Below zero is required for it to signal low, that's how it works.

Edit: The page I linked to has the signal voltage levels, they are very flexible. Most RS-232 can use TTL but that is definitely not how it's supposed to work.
Right. But... Why would pin 2 (TX in a 25 pin dsub) be low or high? That line isn't a switch. That's what makes me think the assholes that built the machine made it not quite standard... The machine is a 94 or so.
 
Right. But... Why would pin 2 (TX in a 25 pin dsub) be low or high? That line isn't a switch. That's what makes me think the assholes that built the machine made it not quite standard... The machine is a 94 or so.
Because it is transmitting a "0" or idle. TX would either be low or high, meaning the transmit pin would either be -3 to -15 volts for low or 3 to 15 if it is sending a "1" Maybe I'm not getting exactly what you're asking? The TX port will go high when it starts sending, normally with a start bit followed by 8 data bits and then a stop bit which are just high low transitions.
 
  • Like
Reactions: Mike_H
I guess I’m dating myself by admitting I have a crimp tool, insertion tool, and removal tool for the male and female pins for RS-232 and similar db style cables.

I surely don’t remember the pin outs though.
 
  • Like
Reactions: pagrey
What brand machine? It’s not rocket science unless you are converting rs232 to fiber then back to the 232. Fanuc? Mitshibushi? Age3? They are all similar but have slightly different needs.
 
What brand machine? It’s not rocket science unless you are converting rs232 to fiber then back to the 232. Fanuc? Mitshibushi? Age3? They are all similar but have slightly different needs.

No conversion. It's a mid 90s Ewag RS12. Uses a Num760 controller.
 
How are you measuring the voltage on the pin? When it is transmitting a logic high, it is shorting the pin to ground. If you are just using a multimeter it is too slow and will just give an average reading (think pwm), this is where an oscilloscope would be needed.

Do you have the old cable? Where did the three wires break? Can you not splice it back together or atleast match wire color to pin?
 
How are you measuring the voltage on the pin? When it is transmitting a logic high, it is shorting the pin to ground. If you are just using a multimeter it is too slow and will just give an average reading (think pwm), this is where an oscilloscope would be needed.

Do you have the old cable? Where did the three wires break? Can you not splice it back together or atleast match wire color to pin?
I'm using a multi meter. I'm not trying to capture data transfer. I'm trying to capture what pins are really my RTS and DTR pins.

The cable had three broken wires (of seven) at the 25 pin Dsub. We have pictures of it when it first came apart. We've tried all combinations of those three wires without success. So, now I'm trying to reverse engineer it to find out what is actually going on. I have a new serial card coming too...
 
Well you learn something every day. I always assumed 232 was just a physical layer standard like 485, but I guess it also establishes the protocol. I use 485 all the time, but I still have to have a protocol (modbus RTU, bacnet ms/tp) to dictate how the data is structured and interpreted.
 
Quick update: I think it's working again. At least, I'm getting an error at my machine now. I had a bad serial card. It doesn't like something in the code (DNC line error) Now, to figure out the proper comm settings. I have a long night of reading ahead of me.
 
Last edited:
  • Like
Reactions: pagrey and Wheeler
Ugh...I feel like I'm close...I have the handshaking down, I think. Pretty sure I have my Port setting correct. My PC will transmit to the CNC and the CNC will transmit to the PC. However, the Program doesn't actually go to the machine, nor does anything come back from the CNC to the PC. I can read my monitor and when I send the program from the CNC to the PC, all I get are null values. I assume that is what is heading to the machine too, but its just not displaying them.

Any ideas?