Skip to content

Conversation

TaikiAkita
Copy link

For Modbus TCP, the PDU length can be computed directly from the Length field of the header (MBAP).

For Modbus TCP, the PDU length can be computed directly from the Length field of the header (MBAP).
@cla-bot
Copy link

cla-bot bot commented Jun 19, 2022

We require contributors to sign our Contributor License Agreement. In order for us to review and merge your code, please fill https://forms.gle/5635zjphDo5JEJQSA to get added. Your document will be manually checked by the maintainer. Be patient...

@TaikiAkita
Copy link
Author

CLA signed.

@karlp
Copy link
Contributor

karlp commented Jun 20, 2022

How does this help with anything though?

@TaikiAkita
Copy link
Author

TaikiAkita commented Jun 21, 2022

How does this help with anything though?

Recently, I tried to use modbus_send_raw_request() and modbus_receive_confirmation() to implement vendor-specific function code.
But the length returned by modbus_receive_confirmation() seems to be incorrect. This patch is intended to fix this problem (currently for Modbus TCP only).
For Modbus RTU, there seems to be no reliable way to fix this issue, since 3.5 chartime is really strict for non-realtime operating systems and there is no Length field (or something like that) in RTU frame.

@TaikiAkita TaikiAkita closed this Jun 21, 2022
@TaikiAkita TaikiAkita reopened this Jun 21, 2022
@cla-bot
Copy link

cla-bot bot commented Jun 21, 2022

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Ji WenCong.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

The PDU length computes from MBAP Length field shall be validated to ensure that PDU is not too short to be read.
@cla-bot
Copy link

cla-bot bot commented Jun 21, 2022

We require contributors to sign our Contributor License Agreement. In order for us to review and merge your code, please fill https://forms.gle/5635zjphDo5JEJQSA to get added. Your document will be manually checked by the maintainer. Be patient...

@karlp
Copy link
Contributor

karlp commented Jun 27, 2022

The only right way of handling custom requests is via one of the other PRs, #140 or similar. Your method only helps for tcp, and only for some cases, it doesn't sound like code that should be "standard" in the library?

@TaikiAkita TaikiAkita closed this Jul 1, 2022
@TaikiAkita
Copy link
Author

The only right way of handling custom requests is via one of the other PRs, #140 or similar. Your method only helps for tcp, and only for some cases, it doesn't sound like code that should be "standard" in the library?

The only right way is following the specification, not a bunch of hacks.
After investigation, the quality of this library can not meet our requirement, so we closed the PR.

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.

2 participants