PDA

View Full Version : looking for modbus/rs*** comm primer...


sevensix2x51
11-30-2010, 9:42 AM
So, I gotta make a bunch of equipment communicate, and I don't really understand what the heck im doing. Im looking for a bound technical/training manual that covers the concepts of modbus-rtu, rs485/232, etc. Stuff like proper wiring, bias resistor calculation, 2/4 wire stuff. Everything on the internet is confusing, so it doesn't help me a whole lot. Hoping for a troubleshooters guide as well, got solid lights in places that should be blinking. This book will be all the training im gonna get.

Any ideas? Thanks, in advance!

cntrolsguy
11-30-2010, 9:49 AM
I have never really come across a book that will teach you the fundamentals of modbus/rtu. The only thing you really have to go buy are the wiring details for 232/485 2w or 4wire. the thing to keep in mind is that rs232 is limited to very short distances also a 4wire 485 can be wired up as a 2wire by combining wires. Do you have any more info on the manufacturer and type of equipment?

cntrolsguy
11-30-2010, 9:52 AM
Here is a good site to start with.

http://www.modbus.org/

sevensix2x51
11-30-2010, 10:31 AM
Thanks for the reply! Im kind of noticing the lack of printed matter on the subject.

The equipment is from multiple manufacturers, spanning rather long distances, and with all manner of noise induced in the wiring, which is not necessarily always shielded. I have to work off preexisting wiring, so this is causing all manner of trouble. I've got a fair self-taught foundation in the basic wiring, but having to wire a two-wire rs485 into a db9 receptacle is a problem, along with interference and not knowing how to accurately spec bias. Ill dig around at the modbus site some more, and maybe I can get some more knowhow from there. Now, where's that bottle of excederin?

cntrolsguy
11-30-2010, 11:33 AM
Oh crap, non-shielded pre-existing wiring over long distances (your screwed)! Usually the standard is 1/4watt 10k resisters on both ends and that should help you establish communication but because of your wiring information you will most likely have intermittent communication problems. Keep in mind that some manufacturers have on-board resistors in the form of jumpers if this is the case do not add more resistors and use the on-board ones. Let me see if I can dig up an old wiring diagram pin-out.

cntrolsguy
11-30-2010, 12:01 PM
I have not found 1 of my old diagrams yet, but from what is remember

pin 3 = tx
pin 2 = rx
pin 5 = signal ground (shield)

This is for a 2 wire hookup.

sevensix2x51
11-30-2010, 1:01 PM
Ok, I think that's the way I did it. 1 thru 5 are all on the top row, iirc? Thanks for the help.

Ill try out some 10kohm resistors, and take it from there. The engineer told me to use 120ohm at the far end only, so this could be a real key tidbit! Thanks again!

cntrolsguy
11-30-2010, 1:53 PM
Ok, I think that's the way I did it. 1 thru 5 are all on the top row, iirc? Thanks for the help.

Ill try out some 10kohm resistors, and take it from there. The engineer told me to use 120ohm at the far end only, so this could be a real key tidbit! Thanks again!

Your right, It is 120ohm but definitely at both ends not just 1. The resistors prevent signal bounce which garbles up the signal and that is why they have to be at both ends. Also make sure your comm settings are set correctly @ both ends. The slower the speed the less chance of comm problems.

cntrolsguy
11-30-2010, 2:00 PM
Another thing to try is to download Modscan32 and get a 232/485 converter to hookup to a laptop and make sure the device is actually talking. If you cant find Modscan32 on the interwebs pm me your email addy.

sevensix2x51
12-01-2010, 9:44 AM
Beating my head against the wall some more. Got my bias in, checked my wiring, regrounded equipment and shields where applicable, swapped polarity like 4 times, and that solid rx light is still laughing at me. Also only can milk 75mV out of this thing on signal. Doesn't it need a min 200mVDC? Ugh, good thing those energy drinks are 2 for $3 at 711... doesn't hhelp that I don't have clearance to get into the master and look at the programming. Boo. At least im paid by the hour. Thanks again for your help. Im going to try and find some docs from the manufacturers on this stuff...

cntrolsguy
12-01-2010, 10:55 PM
That sucks dude! Right off the bat the fact that you have a solid rx light tells me that the wiring is wrong and since as you stated you are using existing unshielded wiring I would be cash money or ammo that there is a short in the old wiring. Can you get to the physical module itself that you are trying to communicate with. Who is the manufacturer and what model #? I have done probably 150 modbus interfaces or more in my career and will try to help you as much as i can and in my experience what your up against with existing wiring is almost impossible to accomplish without getting right up to the unit you are trying to talk to and make sure it actually talks. Take all the middle men out, so to speak. just outta curiosity what industry are you in?

sevensix2x51
12-03-2010, 10:10 AM
Sorry for late reply. I agree about the wiring issue, and ive seen the green light of death when bias is incorrect also.. Got pulled off to another job for a bit, so this quandry is on the back burner for a bit. Not sure im supposed to talk too much about the application and products(secret squirrel, trying to keep to generic issues), but I do have access to both ends. I think im just going to try and run out a few hundred ft of twisted shielded and direct wire it, to make sure it will talk in a perfect world. It doesn't help that the technical manual for the slave device is written in cyrillic. :eek:
ill keep you posted, when I get back out there. Thanks again!