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

Check group SubDevice states in chunks of 16 #237

Merged
merged 7 commits into from
Sep 26, 2024
Merged

Conversation

jamwaffles
Copy link
Collaborator

This makes the state check 16x more efficient by sending a single EtherCAT frame with state requests for (up to) 16 SubDevices in the group.

It would be great if the chunk size could be computed based on the PDU size specified by the user, but Rust isn't there yet. A chunk size of 16 was chosen quite arbitrarily as a balance between allowing small PDU sizes but more efficient state checks.

This makes the state check 16x more efficient by sending a single
EtherCAT frame with state requests for (up to) 16 SubDevices in the
group.

It would be great if the chunk size could be computed based on the PDU
size specified by the user, but Rust isn't there yet. A chunk size of 16
was chosen quite arbitrarily as a balance between allowing small PDU
sizes but more efficient state checks.
The frames are different now that the state check is grouped
@jamwaffles
Copy link
Collaborator Author

Also fixes a subtle bug when freeing up frames for reuse. I believe this bug is only caused when a multi-PDU frame is sent with n PDUs where n is a multiple of the PDU storage size.

@jamwaffles
Copy link
Collaborator Author

Tested on my local test bench with 16 devices. Also tested by another user on a much larger network which also works fine with this change.

@jamwaffles jamwaffles merged commit a4fa32a into master Sep 26, 2024
10 checks passed
@jamwaffles jamwaffles deleted the faster-all-op branch September 26, 2024 13:08
jamwaffles added a commit that referenced this pull request Sep 27, 2024
This was previously done in chunks of 16 in #237 but that was a pretty
arbitrary limitation.
jamwaffles added a commit that referenced this pull request Sep 28, 2024
jamwaffles added a commit that referenced this pull request Sep 30, 2024
This was previously done in chunks of 16 in #237 but that was a pretty
arbitrary limitation.
jamwaffles added a commit that referenced this pull request Sep 30, 2024
jamwaffles added a commit that referenced this pull request Sep 30, 2024
* Automatically handle `more_follows` flag

* Fill frame with as many status checks as will fit

This was previously done in chunks of 16 in #237 but that was a pretty
arbitrary limitation.

* Fix Ctrl+C in DC example

* Limit checks per frame

* Replace #237 with this better 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.

1 participant