Closed GoogleCodeExporter closed 9 years ago
The 0x00 unit id (slave address) is used to represent the broadcast address.
All servers are required to respond to this (and this or 0xff is the default in
modbus tcp/udp) unless they are operating as a bridge.
I agree it should be specified, and I like the simple implementation as that
allows the user to choose which slave they would like to hit (defaulting to
broadcast). I do however need to add the address specifying and checking on the
server side. Let me know if this is okay.
Original comment by Bashw...@gmail.com
on 9 Feb 2011 at 4:02
[deleted comment]
Here is the relevant change:
http://code.google.com/p/pymodbus/source/detail?r=106
As for the server, I think I am actually handling that correctly, so it
shouldn't be an issue.
Original comment by Bashw...@gmail.com
on 9 Feb 2011 at 4:10
Sure. Didn't know about the broadcast address; obviously the device I'm
communicating with doesn't either ;-). At least it refused to respond
to messages with uid 0...
Original comment by albert.k...@gmail.com
on 9 Feb 2011 at 4:13
Original comment by Bashw...@gmail.com
on 9 Feb 2011 at 4:20
Thanks for the quick fix. In the future, there might be other use cases
that demand a different unit_id. If this happens, you might want to
consider adding unit_id as a third parameter to the *Request classes.
But for now, the solution seems sufficient.
Regards, Albert
Original comment by albert.k...@gmail.com
on 10 Feb 2011 at 8:24
This issue was updated by revision r108.
I forwarded the kwargs for the request/response messages to the base
pdu which pulls out the unit and sets it.
Original comment by Bashw...@gmail.com
on 10 Feb 2011 at 4:38
Just use this, I tried and It works:
res = client.read_holding_registers(3999, 24, unit=2)
Original comment by longq...@gmail.com
on 26 May 2014 at 7:33
Original issue reported on code.google.com by
albert.k...@gmail.com
on 9 Feb 2011 at 2:44