Silly dart at the board question about Modbus

SiriusMark

Member
Join Date
Mar 2014
Location
Colorado
Posts
80
When assigning slave id's in Modbus, do the ID's need to be in the same sequential order as the devices in the chain?

In other words, does the very first device on the Modbus network have to be the lowest slave ID (typically 1), the next device 2, the next device 3, etc? Or can they be identified in any order, as long as there are no duplications and they are properly phsycially wired in sequence?
 
They can be any legal unique number and wired in any sequence, as long as the wiring is correct. All the slaves will "hear" all the requests from the master, but they will only respond to those that match their own ID number.
 
Thank you. That's what I thought, but I'm having a comm issue with a newly added device and I'm trying to think of anything I may have missed or not known about. I'm wiring in a Waukesha ESM display module. It has a pass-through port that allows you to connect it to a modbus network. There is actually only 1 other device on this network currently, but every time I add the display module it causes havoc. It doesn't kill communications outright, but it causes instability resulting in random drops of polling info. I'm trying to pin it down.
 
All of the following is assuming this is Modbus RTU over a serial cable:

Check your terminating resistors. If they are not installed, add them. If they are installed make sure you have installed the terminating resistors only at the physical ends of the cable and not on all three drops.

Also, forgive me for asking, but you're not trying to communicate with two slaves over RS-232 are you.

And you're not trying to talk to both slaves simultaneously.

Serial Modbus RTU requires a trunk cable. It will not work in a star configuration.
 
Don't worry about hurting my ego, I'm admittedly new with Modbus and learning as I go. I'll take a lesson anyway I can get it.

You are correct, it is Modbus RTU over a serial cable, RS485. There is NOT a terminating resistor installed. When you say only at the physical ends of the cable, I am correct in translating that as the "end of the line"? Last device in the chain, right?

Also, forgive ME for asking, but how would I talk to both slaves simultaneously? As I understand it, if both slaves have separate ID's and are wired in series, that won't happen because of the identifier. Is there another method of staggering communications besides that?
 
Trying to talk to two slave simultaneously would depend on how the master is programmed. When you added the second slave to the network you must have modified the master to get it to communicate. Not knowing anything about what's under the hood in the master, I added that comment to the list of possibilities.

Last device in the chain, right?
Last devices, plural. Some devices have built-in terminating resistors with dipswitches or some other method of cutting them into or out of the circuit.
 
Installed a 120ohm resistor between the A and B terminal of the end device, no change. Double checked my wiring, it's in series. Checked the documentation for the original device, an Altronics DE-3000. No reference that I could find to a built in terminating resistor.

Master device is a Digi-IAP, it's set up to accept multiple slaves via RS485, exactly how all the other ones we have in the field are set up. I went and checked everything out in there just to make sure, but it looks good internally. Do you normally connect the shield to the RS485 terminal strip? I have my shield connected at both ends, but I've seen it done with the shield wrapped around the twisted pair as it came out of the insulation. I can try it that way next.

Trying to think of a timing issue, but both devices are set to the same baud rate as the Master.
 
As Harryting said, the shield should only be connected at one end. Make the connection at the end closest to a source of interference.

If you're using full duplex, there will be two twisted pairs in the cable, one twisted pair for transmitted data from the master to the slaves, the other twisted pair for data sent from the slave to the master. The terminating resistors should go across the A and B wires of each twisted pair at the receive end.
 
Last edited:
Baud rate was set to 9600 already, so left that alone.

Disconnected the shield, first at one end, then at the other, then in the middle, then all off them, and there was no change in symptoms.

Have another tech in the field who thinks they are supposed to be hooked up parallel. Since nothing else had made a difference, I tried that just for grins, and the symptoms remained the same.

I don't lose ALL comms, they just become intermittent. The fact that it does the same thing when I hook up in parallel makes me sit back and wonder. I know I had them hooked up in series originally, and I put them back in series after all this experimenting. So why would the symptoms not change between series and parallel?

One last thing I can try is to hook up a terminator at the first device (the master) as well as the last device. I understand that most master devices have a built in terminator. I also know that when I am not trying to connect this second slave, the original existing master/slave pair worked just fine with no terminators on either side. But something has obviously changed, so I need to figure out what.
 
I don't have any experience with the Digi-IAP, but I have worked with the HMS Anybus Communicator which performs a similar function. Is there any possibility that you are putting the data received from the two slaves into the same memory area in the Digi-IAP?
 
Well, the Digi is supposed to just be a port that allows you to put a modbus network onto the internet. None of the data is stored there, it just comes in on one of 2 ports (RS232 or RS485) and then puts it onto an IP network. I'm actually accessing and using the data on my Scada network, via Ignition. I'm not saying it isn't possible, but we have a lot of other Digi's in the field at different areas and I don't have this issue with them.
 
So everyting works until you attach this last device?

When you add the new device:
a) everything becomes intermittent?
b) do you ever get data from the new device?

If a and b are both yes answers, then you may be asking for too much data or have something going on that is causing a conflict.

If you never get data from the new device, but everything else becomes intermittent when it is attached, it sounds like it might be causing a delay because the polls to it fail completely causing the Modbus polls through the Digi to be suspended. This could mean that it is set up wrong or wired backwards.

One of the first things I do when I am in your shoes is swap the wires of the problem device. Sometimes you just ignore what the book says and try swapping the Tx and Rx wiring. There are only a few ways you can wire the thing and I have never blown anything up by having it wrong. Someone correct me if I am wrong but I don't think it can hurt anything and is often simpler and faster than interpreting a manual.

Is this a 4-wire or 2-wire network?
 
Last edited:
I'm halfway there. I have my comms stable. I had to install a resistor at the Digi and at the final device on the chain. There is also a dip switch setting that you have to enable if you're going to put a terminating resistor in.

Here is where I was messing myself up. The other Digi's set up throughout the field were installed by someone else. I was using them, and the manual, as the "how to" on setting them up. None of the other digis have the resistor installed, so I didn't install it when I set up this new one. And it really threw me because the first device I hooked up instantly connected and gave no problems. The second device is inside the same control panel, so I wouldn't think it would matter. It obviously did.

Now I'm still not properly polling the new device, but I suspect that will be an easy fix. The hard part was getting everything to calm down.

One thing I really appreciate from talking to you guys is finding out that sometimes, everyone just swaps wires and hopes that does it. I feel stupid when I do it, because it's like easter egging, but since it works sometimes, you can't count it out.
 
All RS485 comms need a 120 ohm resistor at both ends as far as I know - this includes CAN and all others I have ever used. I carry packs of 120 ohm resistors in my laptop bag always.
 

Similar Topics

Is there a way to reset the count on the RS Logix BackUp?? XXXXX PROGRAM IN PROGRESS_BAK445.RSS XXXXX PROGRAM IN PROGRESS_BAK446.RSS XXXXX...
Replies
8
Views
256
Folks. Iv the luxury of replacing a PVP7 that got hosed down internally this morning. It happens here. I'm used to it. However, today, the...
Replies
16
Views
5,195
Hello everyone, this might be a stupid question but I will still ask lol I just start working at a new place and all the PLC programmer get...
Replies
3
Views
1,328
I am installing my first Bardac PL DC Drive. Wiring and programming phase. I tried testing the drive healthy O/P. pulled the thermister and field...
Replies
2
Views
1,469
I am was looking at the details of a Allen Bradley plc output card. The rack is a 1756 Allen Bradley, the card is OB32 which means its a discrete...
Replies
11
Views
3,903
Back
Top Bottom