Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow modbus tcp slave id to be zero #2799

Closed
nichokap opened this issue Jan 3, 2024 · 8 comments
Closed

Allow modbus tcp slave id to be zero #2799

nichokap opened this issue Jan 3, 2024 · 8 comments
Assignees
Milestone

Comments

@nichokap
Copy link

nichokap commented Jan 3, 2024

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.

@Limraj Limraj added the community Community Reported Issues label Jan 3, 2024
@Limraj Limraj added the to check label Jan 9, 2024
@Limraj Limraj added this to the 2.7.7 milestone Jan 9, 2024
@Limraj
Copy link
Collaborator

Limraj commented Jan 9, 2024

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

@nichokap
Copy link
Author

nichokap commented Jan 9, 2024

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.

@Limraj
Copy link
Collaborator

Limraj commented Jan 9, 2024

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.

@nichokap
Copy link
Author

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

@Limraj Limraj added the modbus label Feb 15, 2024
@Limraj Limraj modified the milestones: 2.7.7, 2.7.8 Feb 29, 2024
@Limraj Limraj self-assigned this May 10, 2024
@Limraj Limraj modified the milestones: 2.7.8, 2.8.0 Jul 5, 2024
@Patrykb0802
Copy link
Contributor

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

@Limraj Limraj modified the milestones: 2.8.0, 2.9.0 Aug 7, 2024
@nichokap
Copy link
Author

hello @Patrykb0802, thank you for your feedback. The issue I am facing is due to the strange behaviour of this specific Allen Bradley device. The only way to communicate with it is to send Modbus TCP requests with Slave ID =0. The question is from my side is simple, do you still have plans to allow setting Slave ID = 0 in Modbus TCP requests in a future release?

@Limraj
Copy link
Collaborator

Limraj commented Dec 14, 2024

Hi @nichokap,
Yes, we will probably add this option in the next version, it does not require much work. However, we are asking for some cooperation, e.g. by committing to confirm whether the correction worked.

Regards.

@nichokap
Copy link
Author

Hi again @Limraj,
I do commit to check it given that I will still have access to the Allen Bradley devices (as we speak they are still available on my work environment).

Patrykb0802 added a commit that referenced this issue Dec 16, 2024
Added option to set modbus data point slave id to range from 0 to 255 instead of range from 1 to 255
@Limraj Limraj modified the milestones: 2.9.0, 2.8.0 Dec 18, 2024
Limraj added a commit that referenced this issue Dec 18, 2024
…ave_id_to_be_zero

#2799 Allow modbus tcp slave id to be zero
@Limraj Limraj closed this as completed Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants