Pages: [1]   Go Down
Author Topic: Arduino +Modbus RTU Library + Xbee  (Read 3132 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi everyone.

I have been playing around with Modbus RTU library on the Arduino and use an Xbee Pro radio and able to read Modbus registers just fine.
I decided to build a second slave but having problems talking to both slaves.  If i turn off either slave, I have no problems communicating.
One is address as Slave Id #1 and the other Slave Id#2.

Testing the slave with a Modbus Master the Arduino Slave seems to ignore requests addressed to any slave ID except the ID set in the Arduino.
The Xbee Radio's are programmed (Routers and Coordinator in AT) mode. Many to one configuration.
I assumed only the slave with the proper Slave ID would respond since the Coordinator only polls one slave at a time.

Does anyone know of a Modbus Library for the Arduino that allows multiple slaves on a serial network?
Anyone have a simple sketch / library or idea's why this isn't working.

The library I have tested are "Modbusino" and Modbus Slave downloaded from https://sites.google.com/site/jpmzometa/arduino-mbrt

Thanks.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
I'm trying to do the very same thing.  It's a little strange because if the MODBUS library is written correctly, the slave should not respond unless the message is addressed to it.  On a wired RS-485 all the slaves receive every message and only the properly addressed one sends back a response, so in essence you should be able to broadcast to every slave device. I took a look at the code and the last if statement in the method modbus_request shows that is returns a NO_REPLY if the slave number does not match what is encoded in the packet.  You might be able to start troubleshooting there.

I'd like to ask what XBee modules you are using and how you have them configured.  I can't seem to get the master to communicate to one slave.  I'm thinking there might be a timing issue with MODBUS RTU protocol over wireless.
Logged

Pages: [1]   Go Up
Jump to: