Skip to content

Conversation

@SamirBou
Copy link

Add ability to scan the counts of different registers and read their values. Also added modbus parsers.

Copy link
Contributor

@d3vco d3vco left a 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:
Copy link
Contributor

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?

Copy link
Author

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

batch_size = min(remaining, 10)

success = False
while batch_size > 0 and not success:
Copy link
Contributor

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?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added _read_batch function

Copy link
Contributor

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):
Copy link
Contributor

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.

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