Modbus RTU communication
I have a network of 10 industrino D21Gs with plans to add in 8 more. I am using 24AWG belden RS485 cable to connect them, and each one is about 30 feet apart. I am only able to communicate with the 8 closest industrinos using modbus RTU with the 'simplemodbusslave' library, and a computer acting as the modbus master on one of the extreme ends of the bus. However, I am able to communicate properly with all the slaves if I move the modbus master to the center of the bus so there is a shorter distance to the most distant slaves. I am thinking that I have something wired in a way that isn't ideal (line termination, ect.) as, once the slaves reach a certain distance away, I am unable to communicate with them anymore. This distance is around 400 feet, which shouldn't be an issue if I have everything hooked up properly. I am just looking for some insight to what I might be doing wrong, or if what im trying to do is even possible with the industrinos?
I have 3 data cables connected to each industrino (A, B, and the ground), and each industrino is powered using a 24dc power supply. I dont have the data ground wired into the earth ground anywhere (is this right?), and I have tried putting a 120ohm resistor between A and B on each end of the bus. Also I am using a STARTECH rs485 to serial adapter connected to the computer as the modbus master, I have also tried using an industrino as the modbus master, but was only able to communicate with 6 slaves.
Thanks Tom, I was able to get things working with your help. I somehow overlooked that there were built in resistors, all I needed to do was remove the jumpers in every slave, except for the 120 ohm one in the last slave on the bus.
Hi quentin,
As an old hand in Modbus and various field networks, I recommend to completely remove the jumpers on every unit of the network, and replace them with real resistors (0.1% precision, but I am quite the maniac with resistors). It will no throw your accountant int fits, and it will avoid quite a bunch of later client calls like "I did nothing wrong and my whole network crashed", when he "just" replaced a mobule by another, forgetting to remove any of the jumpers, of course.
Since termination resistors are seldom activated by default, adding something to the network will generally work. If not, the problem will often (hopefully) affect only the new item, and seeing the resistors on the end units could help some remember.
Didier, DG2R
Hi quentin,
As an old hand in Modbus and various filed networks, I recomend to compeletely remove the jumpers on every unit of the network, and replace them with real resistors (0.1% precision, but I am quite the maniac with resistors). It will no throw your accountant int fits, and it will avoid quite a bunch of later client calls like "I did nothing wrong and my whole network crashed", when he "just" replaced a mobule by another, forgetting to remove any of the jumpers, of course.
Since termination resistors are seldom activated by default, adding something to the network will generally work. If not, the problem will often (hopefully) affect only the new item, and seeing the resistors on the end units could help some remember.
Didier, DG2R
Hi Quintin, let me give a few suggestions and please let us know your observations.
As far as i know, the shielding of the RS485 cable should only be connected on one side to GND, so leave it unconnected on the other side. The purpose is to shield the cable, not to create a common GND between the Industruinos.
Have you tested with different Modbus settings? Please try baud rate 9600.
Does your modbus master software offer any diagnostics? If you use an Industruino as modbus master, the library has some troubleshooting features, you can read the values of: packets[0].connection and packets[0].retries and packets[0].failed_requests
You can also make the connection persistent with: packets[0].connection = true; // this makes sure connection never drops after x retries
I assume you have already tried different values of timeout, polling, retries on the master side?
As in our documentation, we suggest the following settings for the termination resistors (3 jumpers on the baseboard of the INDIO):
On the MASTER leave all 3 jumpers in place.
SLAVE (leave only the middle jumper):
-
120R between A and B => IND.I/O: leave middle jumper
-
100R in series on GND => IND.I/O has 560R by default
-
no pull-up or pull-down => IND.I/O: remove top and bottom jumpers
Your answer
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
Keep Informed
About This Forum
This community is for professionals and enthusiasts of our products and services.
Read GuidelinesQuestion tools
Stats
Asked: 8/27/18, 6:13 PM |
Seen: 3478 times |
Last updated: 8/30/18, 4:29 PM |