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

[Feature Request][MODBUS]: Build a QueryOptimizer for PLC4J Modbus #1671

Closed
2 of 16 tasks
chrisdutz opened this issue Jun 19, 2024 · 6 comments
Closed
2 of 16 tasks

[Feature Request][MODBUS]: Build a QueryOptimizer for PLC4J Modbus #1671

chrisdutz opened this issue Jun 19, 2024 · 6 comments
Labels
awaiting-feedback This label is applied when an issue has been opened and we need more information from the issuer. feature java Pull requests that update Java code Modbus https://plc4x.apache.org/users/protocols/modbus.html

Comments

@chrisdutz
Copy link
Contributor

What would you like to happen?

The modbus spec seems to provide limits for the size of packets. However in contrast to the other protocols, is this limit not related to the size of the packet, but by the number of registers/coils.

Please refer to: https://www.modbus.org/docs/Modbus_Application_Protocol_V1_1b3.pdf, page: 11

It should be simple to implement a query-optimizer for Modbus to automatically handle this. The Siemens S7 QueryOptimizer might help with inspiration.

Programming Languages

  • plc4j
  • plc4go
  • plc4c
  • plc4net

Protocols

  • AB-Ethernet
  • ADS /AMS
  • BACnet/IP
  • CANopen
  • DeltaV
  • DF1
  • EtherNet/IP
  • Firmata
  • KNXnet/IP
  • Modbus
  • OPC-UA
  • S7
@chrisdutz
Copy link
Contributor Author

So it seems that the limitations are:

Max 2000 coils in one request (Page 11)
Max 125 registers in one request (Page 15)

@chrisdutz chrisdutz changed the title [Feature Request]: Build a QueryOptimizer for PLC4J Modbus [Feature Request][MODBUS]: Build a QueryOptimizer for PLC4J Modbus Jun 30, 2024
@ottlukas ottlukas added java Pull requests that update Java code Modbus https://plc4x.apache.org/users/protocols/modbus.html feature and removed new feature labels Jul 5, 2024
@chrisdutz
Copy link
Contributor Author

So luckily I need to implement this feature for my $job ;-) Making good progress, however I'm only going to implement this for reading ... writing would possibly open pandora's box with evil issues, which I do not want to do.

@chrisdutz
Copy link
Contributor Author

img_v3_02ed_6339cbe1-6087-420a-a1e5-8b4a1a69112g
So this is the first rough draft ... now I gotta add a bit more of testing to everything ... but more than 10 times faster reads is quite an optimization ;-)

@glcj
Copy link
Contributor

glcj commented Sep 4, 2024

Excellent work, I will run tests, those times are excellent!

@chrisdutz chrisdutz added awaiting-feedback This label is applied when an issue has been opened and we need more information from the issuer. and removed working on it labels Sep 5, 2024
@chrisdutz
Copy link
Contributor Author

Ok ... the changes are merged ... now I think it makes sense to wait another week for some feedback.

@chrisdutz
Copy link
Contributor Author

Ok ... closing this now ... my colleagues haven't been complaining, so it seems to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-feedback This label is applied when an issue has been opened and we need more information from the issuer. feature java Pull requests that update Java code Modbus https://plc4x.apache.org/users/protocols/modbus.html
Projects
None yet
Development

No branches or pull requests

3 participants