Modbus TCP - What is the correct usage of Unit ID?

B

Thread Starter

Benny Cedervång

I am trying to have an ABB AC800M with a Modbus TCP card (CI867) communicate, through a 3G router, with a remote MOXA W5340-HSDPA I/O with build in 3G modem.

We have found the problem and it’s the "Unit Identifier" address that doesn't match between AC800M and the remote MOXA I/O. The remote MOXA I/O is listening on unit ID 0 or 1 and AC800 use 255.

In the manual "Modbus_Messaging_Implementation_Guide_V1_0b.pdf", on page 23, it says that 255 is the value to be used.

MOXA says that it is wrong to use 255 and the value 0 or 1 should be used.
What is correct?

(It is not possible to change the Unit ID in either ABB nor MOXA) :(

I'm also a little confused when reading the note about the UnitID in the manual. Would it be possible to get a more extensive explanation of that part?
 
---- snip ----

> In the manual "Modbus_Messaging_Implementation_Guide_V1_0b.pdf",
> page 23, it says that 255 is the value to be used.
>
> MOXA says that it is wrong to use 255 and the value 0 or 1 should be used. What is correct?

---- snip ----

I believe that they are both wrong.

In Modbus TCP there is no need for UnitID, since the devices are identified by the IP and the UnitID should be ignored.

I don't know why there are devices that work only with a specific UnitID.
 
L

Lynn August Linse

Welcome to Modbus :)

I've worked with Modbus since the late 1980's. All comments on unit id 255 arrived very late in the game, so don't expect many people to use. The 'first' Modbus/TCP spec said to use 0. I'm not familiar with the products you mention, so speak in general.

Technically, 255 would apply when you talk to a 'bridge device', in other words slave #1 would be the device beyond what you talk to, and 255 is the thing enable the comm to #1.

Most bridges just automatically assume Unit ID #0 is like #1.

Most traditional Modbus/TCP devices ignore the unit Id completely.

So there is no 'right answer' other than to do what works. Trying to black-mail a vendor, saying they violate the Modbus-spec if they don't support 255 is a waste of breath - Modbus isn't like that.

You do what works, and generally can get it working with Modbus. It is part of the charm of Modbus. :)
 
F

Fred Loveless

The unit ID is used when dealing with Modbus Bridges. Typical bridges convert Modbus TCP to Modbus serial or Modbus plus. The Unit ID is either the device Id of serial device or it is index number that references a Modbus plus layered address.

If you are talking to a Modicon controller you will not need the unit ID, most software appends an id of 0 to the OP address. If you are using a Moxa Modbus TCP to Modbus Serial converter you will need to use the IP address of the converter and the unit (device) id of the hardware you are requesting data from on the other side. And 255 is not a valid Device ID for most Modbus serial protocol devices.
 
T

Tallak tveide

The unit id comes into play when several devices are connected to one IP address, and this is not a common scenario. Normally the unit id is set to one, I think many devices ignore this...
 
J
> The unit id comes into play when several devices are connected to one IP
> address, and this is not a common scenario. Normally the unit id is set to
> one, I think many devices ignore this...

I've seen this required on devices that are "unintentionally" bridges. That is, a device which ties its Ethernet and RS-485 ports together and broadcasts whatever shows up on one side, onto the other if the packet isn't for themselves, but isn't "just a bridge". Morningstar seems to do this with their solar power equipment, and I've run into other products that do likewise.

That said, the comments that the OP needs to do "whatever works" are correct. Modbus is very flexible, which is both a blessing and a curse.
 
Top