-
Notifications
You must be signed in to change notification settings - Fork 4
Add modbus scan registers ability and modbus parsers #6
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
base: main
Are you sure you want to change the base?
Conversation
d3vco
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work, @SamirBou, this will be a valuable addition to the plugin. Just one implementation change requested that will benefit future us.
|
|
||
| scan_results = [] | ||
|
|
||
| for func_code, read_func, max_per_request, name, output_name in func_specs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we break out a "find highest address" function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added _find_highest_address function
src/modbus/actions/spec.py
Outdated
| batch_size = min(remaining, 10) | ||
|
|
||
| success = False | ||
| while batch_size > 0 and not success: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And a "read batch" function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added _read_batch function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to work on a CI action to help generate these binaries
|
|
||
|
|
||
| @ModbusClient.action | ||
| def scan_modbus(self, device_id=1): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea for a new action and solid execution. I think it would be helpful for maintenance to split this function up a bit.
Add ability to scan the counts of different registers and read their values. Also added modbus parsers.