Report slave id command clarification

M

Thread Starter

mbusland

hi all:

as a newbie in Modbus I am trying to understand the importance of 'Report slave-id' command. My firmware currently only supports Function-codes 3,6 and 16.

How important is it to support the 'report slave-id' command and respond with a particular device specific information?

Can we not instead ask them to query a location in memory and report let us say a hardware-version which is unique?

What is the general practice in the industry? I am trying to do what is acceptable to most systems/EMS.

Thanks!
 
L

Lynn August Linse

Report slave-id command is RARELY supported on devices, and masters who understand are even rarer. You'll notice that the response includes bytes tagged as 'device-specific', which means it is difficult to do anything meaningful with.

You are fine to read/write the Modbus slave id as a normal holding register supported by 3/6/16.

- Lynn
 
J

JulieInAustin

> Report slave-id command is RARELY supported on devices, and masters who
> understand are even rarer. You'll notice that the response includes bytes tagged
> as 'device-specific', which means it is difficult to do anything meaningful with.

> You are fine to read/write the Modbus slave id as a normal holding register supported by 3/6/16.

Not sure what you're suggesting here, but Report Slave ID doesn't map to any object in any of the address spaces. Since most people who use that just want the "run" byte, querying a slave with just about any function (I read input register 0 ...) and looking at the completion status (OK or exception) will tell you it's "running". A timeout means "nope".

Report Slave ID is mostly useful for self-configuring networks, which are even more rare than Modbus masters which support the function. In those sorts of configurations, the master walks the bus, finds the responding units, queries their "slave ID", examines the "device dependent" glarp, then loads the appropriate drivers.

One comment on the functions you're supporting -- I'd strongly encourage you to support function 4 (READ INPUT REGISTERS) as some applications will use function 4 when it isn't planning to change the contents with WRITE SINGLE REGISTER or WRITE MULTIPLE REGISTERS.

If any of you are looking for a Modbus implementation to supports just about every message imaginable, "j2mod" on SourceForce is an open-source Java master and slave implementation.
 
Top