Electronic – Best way to poll for Modbus RTU slaves through a Modbus TCP gateway

modbus

I'm using a number of Modbus RTU devices connected to my PC through a Modbus TCP gateway. I'd like to poll all the available slave addresses to check which ones are available through my program.

What would be the best way to do this ?? I guess I could just do a read on some arbitrary register but I would like to use a method and value that's common to all devices.

The official Modbus Application Protocol guide mentions a Diagnostics function code but that seems to be for serial line devices only.

Best Answer

There are no guaranteed addresses or registers with ModBus; that's one of its biggest failings (or one if it's greatest strengths, depending on how (in)experienced you are in the field). There have been numerous attempts to generate some kind of standard for common devices but ultimately there is no way to do this since there is no standards body oversight for such a thing to succeed.