Solved

Serial Communication Problems

Posted on 2012-03-22
15
372 Views
Last Modified: 2012-04-18
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?

Thanks
0
Comment
Question by:compsol1993
15 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 37755269
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.
0
 

Author Comment

by:compsol1993
ID: 37755304
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.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 37755623
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.
0
 
LVL 69

Expert Comment

by:Callandor
ID: 37756898
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.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 37758056
He would have to run the monitor and possibly printer that way too and any other AC powered device connected to the tower.
0
 
LVL 14

Expert Comment

by:JohnnyCanuck
ID: 37759108
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?
0
 

Author Comment

by:compsol1993
ID: 37763778
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.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 37763820
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.
0
 

Author Comment

by:compsol1993
ID: 37763828
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.
0
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 37763887
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.
0
 
LVL 3

Expert Comment

by:algorith
ID: 37785937
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.
0
 

Author Closing Comment

by:compsol1993
ID: 37858217
Thanks for all of your help on this.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 37858424
You're welcome.  What was the problem?
0
 

Author Comment

by:compsol1993
ID: 37860595
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.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 37862187
Ok, thanks.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now