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

Limit modbus quantity #721

Merged
merged 2 commits into from
Dec 31, 2022
Merged

Conversation

nielsbasjes
Copy link
Contributor

When requesting too many registers in a single modbus request the request will fail with a very unclear modbus error from the actual device at hand.

The modbus specification (pdf) documents limits of at most 125 registers or 2000 coils in a single request which matches with the limits I have observed in the modbus enabled appliance I have here.

This change will simply let the application fail before making the connection instead of the actual device returning a very unclear modbus error.

@chrisdutz
Copy link
Contributor

Hi Niels,

thanks for that ... I guess this would be a good first step, but I think the ideal solution would be to allow using more registers and coils in Modbus using the PLC4X API and to internally split them up into multiple requests. I think if you have a look at the S7Optimizer, this should be the best source of how to achieve this, however I guess as we're not taking about calculating packet sizes of the response it should be A LOT simpler.

Would you be interested in taking on this feature?

Chris

@chrisdutz chrisdutz merged commit b741171 into apache:develop Dec 31, 2022
@nielsbasjes
Copy link
Contributor Author

I was also thinking about such an option.
Because I'm not familiar with the code yet I opted for this simpler fix as a first step.
I'll have a look at the class you mentioned and see if I can make this happen.
No promises yet.

@nielsbasjes nielsbasjes deleted the LimitModbusQuantity branch December 31, 2022 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants