ArduinoModbus.h - Polling from multiple Arduino Slaves over RS485 4-wire

Hi,

Please allow me to tell you about the setup first:

4x slaves:

  • 2 of the slaves are Arduino MKR Zero with PmodRS485 over a 4-wire bus with common GND.
  • 2 other slaves are 3rd party devices that are also on the same bus as Arduino

Master:

  • Modbus Poll, termination on the bus

In the Arduino program, I am using ArduinoRS485.h and ArduinoModbus.h libraries.

What is the situation?

  • I can poll from any Arduino Individually (only polling one Arduino), as fast as 20ms, no error, everything fine.
  • If I connect another Arduino to the bus and try to poll both, it would be only possible if I increase the poll interval from 20ms to 450ms, otherwise, the Slave that has higher SlaveID will only talk and cannot poll anything from the Arduino slave that has a lower SlaveID.
  • Both Arduino uses the same sketch, same wiring, same components, and only the Arduino that has a Higher SlaveID will only talk in fast pollings (under 450ms)
  • If I connected all the slaves to the bus, I can poll from everyone as fast as 100ms, except the Arduino that has a lower SlaveID.
  • If I try to change the SlaveID of Arduinos during operation, as soon as one has a higher SlaveID, will become dominant.
  • PmodRS485 has DE and RE (neg), and I am using both (checked the voltage while polling, it is working)
  • I tried only using the DE pin and connect the RE to GND, no difference
  • 10k Resistors on Rx, Tx line, no change
  • Termination for PmodRS485, and no termination, no change.
  • the only way that I can poll from ALL the slaves without error is to increase the interval to 500ms, but as soon as I remove one Arduino, and only have the one (together with 2x 3rd party slaves) I can poll as fast as 100ms.
  • The RS485 bus itself is fine, as I have more Slaves with different chipsets and terminations (up to 12 slaves) and everything works fine.

Please let me know if I can provide more information.

thanks,
Pew

Is the bus being driven during the 20-450ms period, or is it idle?
If it is being driven, which Arduino is doing the driving?

Also check the soldering on your PmodRS485 adaptors. Hopefully it is better than the picture shown on the product page https://reference.digilentinc.com/_media/reference/pmod/pmodrs485/pmodrs485-0.png

mikb55:
Is the bus being driven during the 20-450ms period, or is it idle?
If it is being driven, which Arduino is doing the driving?

Also check the soldering on your PmodRS485 adaptors. Hopefully it is better than the picture shown on the product page https://reference.digilentinc.com/_media/reference/pmod/pmodrs485/pmodrs485-0.png

That is pretty bad. Hand soldering people sometimes have to take a break, but the visual inspector should have caught it errors.
Paul

mikb55:
Is the bus being driven during the 20-450ms period, or is it idle?
If it is being driven, which Arduino is doing the driving?

Also check the soldering on your PmodRS485 adaptors. Hopefully it is better than the picture shown on the product page https://reference.digilentinc.com/_media/reference/pmod/pmodrs485/pmodrs485-0.png

thank you for your response; it is been driven by the FIRST arduino that is been polled by Modbus poll.
in the sequence of polling, whomever (arduinos) that is first will become dominant and the second one will become timeout. if I change the order the first one will be come timed out.
pretty weird...

Paul_KD7HB:
That is pretty bad. Hand soldering people sometimes have to take a break, but the visual inspector should have caught it errors.
Paul

I understand your concern, however, in my case, the pins are soldered just fine.

I was wondering if there is a problem with the library controlling the DE pin, but since one of them every time is performing well, so...
is it possible that whoever has the DE enabled is holding it for too long and hence not allowing the other one to receive the request from the Master?

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.