Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Created a new function to check if there is content in the mailbox of slaves
Description
The Standard SOEM API offers a function for reading data from the mailbox slave. This function follows the next steps:
The two first steps use different timeouts for their execution and the whole function uses a global one. We need a timeout higher than the first step for the second step.
This function also manages the situation where a message is lost, i.e. the mailbox data has been requested but for any reason the process doesn't get it and then starts to repeat the request to the slave. This uses also the global timeout.
Our application uses two threads for accessing to EtherCAT network. One for sending EoE messages and another for polling the slave reply. The access to the resource is managed with a mutex. If the timeout of the polling thread is too high, the system response is very bad.
So what we have done is add a new function that only checks the context of the slave mailbox (first step) and if it returns successfully, we call the Mailbox receive functions. This allows us to use two different timeouts, one for accessing the mailbox (slow one) and another for checking the content (fast one).
Fixes # ST-262
Tests
Using the EoE_gateway application, connect to a Novanta servo drive using a low-performance computer and check that the communication runs perfectly. The only expected errors are timeouts created because the slave answer is slower than 1 second.
How to stress communication?
Documentation
Pending