Scada-LTS icon indicating copy to clipboard operation
Scada-LTS copied to clipboard

Allow modbus tcp slave id to be zero

Open nichokap opened this issue 1 year ago • 5 comments

When using some Allen Brandley devices, for example the Powermonitor 3000, and request data over Modbus TCP the device ignores the modbus slave id sent through the requests and replies with the slave id section as zero. Thus, in order to accept the responses you must

  • either be able to set the modbus tcp slave id to 0 when sending the request, or

  • accept that through modbus tcp you can send a request to slave id 1 and get a response from slave id 0.

nichokap avatar Jan 03 '24 10:01 nichokap

Hi @nichokap, Could you send us the configuration of this Modbus IP (Data Source and Data Point) in Scada-LTS? We will try to recreate it on our simulator.

Regards, Kamil Jarmusik

Limraj avatar Jan 09 '24 12:01 Limraj

Hello @Limraj,

Thanks for looking that quickly the case. Sorry but i didn't understand your request. I cannot apply the configuration needed because when I write slave id 0 I get an error that the slave id should be between 1 and 255. Thus, saving the configuration and creating a data point is not possible.

If I choose modbus slave id 1, I get an error message that no reply received from this slave id (there is a reply actually, but the modbus tcp response packet has replaced slave id with 0).

Happy to support with anything more you may need.

nichokap avatar Jan 09 '24 17:01 nichokap

Okej @nichokap, I think I now understand what the problem is, you cannot set the slave id to 0, although a physical device is available with such an id, we will try to expand the possibility of entering 0.

Limraj avatar Jan 09 '24 18:01 Limraj

Thank you once again @Limraj . Sorry if I didn't describe it corrently in the first place!

nichokap avatar Jan 10 '24 10:01 nichokap

Hi @nichokap,

The issue you're experiencing with slave ID = 0 is because this ID is reserved for broadcast communication in the Modbus protocol. When using Modbus TCP, setting the slave ID to 0 allows a master to send a message to all devices on the network. This means any device receiving a message with slave ID = 0 will process the request but typically will not send a response to avoid network congestion and collisions.

Here’s a reference to this behavior:

Fernhill Software - Modbus Protocol Overview: "A master can broadcast a message to all devices using address 0 (zero)."

I hope this clarifies why the device is responding with slave ID = 0 and helps you understand the reserved usage for broadcast communication.

Best regards, @Patrykb0802

Patrykb0802 avatar Aug 06 '24 10:08 Patrykb0802