Can any one please suggest me a best way for Auto slave Address Detection on Modbus by Master on both TCP and RTU.
Thanking you in advance.
> Can any one please suggest me a best way for Auto slave
> Address Detection on Modbus by Master on both TCP and RTU.
There are three different strategies I've used -
1) Start at 1 and just keep going, until you either find the device you want, or reach the maximum unit number you want.
2) Define specific ranges for various device types and limit your search to those ranges.
3) Use 1 or 2 and save the results so you don't have to repeat, unless the devices weren't found again.
Modbus slave discovery is a pain if you're trying to do it automatically. The only thing worse is device type discovery as many products on the market don't include either REPORT SLAVE ID or READ MEI in their command set.
Thanks for the reply,
Can you please provide more details regarding REPORT SLAVE ID? I have looked in to that function code but in the response of that function code I have seen SLAVE ID not the SLAVE ADDRESS.
And also can you please explain how this function code can be used to provide support for auto detection of slave address?