Serial Communication Problems

At one of our field offices, we have a field device that communicates over RS-485 (single two wire pair).  Distance is approximately 50 yards through underground conduit.

We use a device which is essentially a RS-232 to RS-485 converter, that connects to the PC via RS-232.  We have a tower in the office (Windows 7), that polls data from the device in the field.  There are two lights on the RS-232 to RS-485 adapter device TD (transmit) and RD (receive).  

This worked perfectly for several months, polling data every 10 seconds.  The it suddenly stopped.  

Connected to my laptop, it still works fine.  When polling data, the TD blinks once, the RD blinks once, and the data shows up on the laptop.

When the device is connected to the tower, (same polling software, same 232/485 device drivers, same Windows OS), the TD light blinks once, and the RD light blinks constantly for 8 seconds (no readable data comes to the PC, looking at the raw data stream, the data coming back appears to be garbage).  

So, I talked to the field device manufacturer and the converter manufacturer, no one has any idea, both say everything is fine if the laptop can connect.

So, I think it's got to be something with the PC.  Maybe the serial port went bad or something like that.  Today I try a second tower, this one with Windows XP, and it has the same problem.  So, my laptop works, but neither tower works.  

Could it be the power, some sort of grounding issue at the field office?  My laptop is running off of battery power, and that's the only thing that I can think of.  

Last thing I tried today, I took the tower to another field office, with the same device in the field, same adapter, plugged it in there, and it polled data perfectly.  No change to the settings on the PC or anything, literally plugged it in and polling commenced within seconds.

Any suggestions, maybe a grounding issue or other thoughts?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
Since your laptop works and the towers don't, that does suggest a grounding issue.  Especially since the tower worked in another office.  Check the wiring.  Maybe they scraped the insulation on one of the wires when they installed it and it's just now making contact with something.  Also, take your laptop charger/power supply to the office and see if it fails when that is plugged in.  Do you know how and have the equipment to make some voltage measurements?  Can you bring the device to the office and use a short cable to connect it to the converter?  That would tell you whether it was the underground wiring.
compsol1993Author Commented:
Thanks for the feedback.  I should have clarified, the field device is literally in a field, attached to a compressor, so no easy way to power the PC tower and monitor etc out there.  I guess it's not impossible though, maybe extension cords.

One other thing I should have mentioned, when the conduit was originally run, four sets of wires were run, thus I have three other candidates under the ground.  I already tried swapping with different pairs of wires (each pair in their own shielded cable), same symptom.  

I could also try running a long pair of wires across the ground to rule out the underground wiring.  

I did plug the laptop into the office buildings power at one point, and it still worked.  The brick only has two prongs though, so that might make a difference.

The manufacturer of the device had some software for watching the raw waveform.  I didn't see any spikes beyond 5 volts from the field device, but I honestly am not sure if it would represent voltages higher than 5.  The rep remoted into the tower, and said the waveform looked good.

Also, not sure if this helps, but I did a long loopback test.  Out in the field, I tied the RX and TX lines together, and loopback worked fine using Hyperterminal.  I setup with the same baud rate and other settings to match the field device.
Dave BaldwinFixer of ProblemsCommented:
The long loopback disconnected from the remote ground didn't it?  And a two-prong plug is not connected to ground.  Actually, it could be that the remote ground has become disconnected and is causing common mode noise beyond what the RS-485 adapter can handle.  It doesn't cause the laptop a problem because it can float with it where the desktops can't.
Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

Try running the tower power supply with a 3-prong to 2-prong adapter to act as a ground lifter - this will verify whether it is a ground problem or not.
Dave BaldwinFixer of ProblemsCommented:
He would have to run the monitor and possibly printer that way too and any other AC powered device connected to the tower.
Just to clarify things, your rs-485 converter plugs into your tower's on board serial port - or do you have a seperate pci serial card installed in the tower?  If its plugged into a seperate pci serial card then switch it to the onboard serial port if possible.  

Does the software expect to poll a particular serial port for the data (eg com1)?

Are the serial port settings set to auto or specific irq and io numbers?
compsol1993Author Commented:
Thanks for everyone's help on this.  

I tried running the tower & monitor (only devices we have) into a 3-prong to 2-prong adapter.  It made no difference.

Yes, the converter plugs into the onboard serial.  We also have a USB to RS-485 adapter, tried that, same symptom with that device.

I also tried running the tower off of a UPS for a few minutes.  We had the same exact problem, running off of battery (even with the 3-2 prong adapters plugged into the UPS).

David Baldwin:  I'm not sure what you mean by the "loopback" disconnected from remote ground.  Our remote field device has two wire connectors A & B.  We don't have a separate ground wire run, this is a straight 2-wire pair.  At least I should say, we've never needed a third wire for ground.  Maybe that is our problem.  To test, I connected a long wire (above ground) to the ground of the power source that drives our field measurement device.  I then connected that to the ground of my RS-485 adapter.  It did not help.  We use this same setup at several other locations, all have worked fine on this single pair of wires running to this particular device.

Anyone have any other thoughts or something else I could try?  

I've even tried running the PC tower off a long run of extension cords, powered by outlets in the small shed where the device that does the measuring gets its power.  Same problem there as well.
Dave BaldwinFixer of ProblemsCommented:
Most RS-485 connections are either two twisted pairs (no handshaking) or four twisted pairs (with handshaking).  There is a way to use only one twisted pair but your hardware and software has to support the direction switching for that to work properly.  Which version do you have?

Note that if the wires are connected to the remote system, they are indirectly connected to the remote ground thru the driver ICs and the power supply.  If you have two or four pair system, disconnecting the wires from the remote unit to make a loopback disconnects them from the remote ground.
compsol1993Author Commented:
Ok, that makes more sense.   Thanks for the clarification on the loopback.

Our device and software does support single twisted pair, in fact that's all it supports.  We have other setups that have RS-485 devices with 2-pair (other locations and different devices altogether), but this measuring device & 485-232 converter has used 1-pair and worked fine for awhile now (until this problem started), and continues to work at our other locations.
Dave BaldwinFixer of ProblemsCommented:
Then you need to focus on the things in that particular installation.  Even though it worked with your laptop, I still wonder about the wiring and about the RS232-to-RS485 adapter.  Even a single pair requires terminating resistors so I would check that.  In fact I would start measuring everything and comparing it to the working systems until I found the thing that was different and probably wrong.  DC voltage between the wires, AC voltage from the wires to ground.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It is possible to get an optical isolator for RS232 or RS485 that would break the grounds entirely. This might be a good idea anyway, just for avoiding future problems.  See e.g. here.

I used one of these once, but the client had bigger problems (signal wires were running in the same conduit as the power wires) and it only helped a little.
compsol1993Author Commented:
Thanks for all of your help on this.
Dave BaldwinFixer of ProblemsCommented:
You're welcome.  What was the problem?
compsol1993Author Commented:
Can't say we know for sure.  We've got a laptop doing the polling now, not an ideal or even long term solution, but I didn't want to leave the question hanging out there.  When we finally figure out a solution, I'll post the details in this thread.
Dave BaldwinFixer of ProblemsCommented:
Ok, thanks.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.