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

Mailbox wrong sm1 stat access #6

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

ghost
Copy link

@ghost ghost commented Aug 8, 2023

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:

  • Check if there is something in the slave mailbox
  • If so, gets the content
  • Process the type of mailbox

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?

  1. Use tune, disturbance and monitoring features
  2. Use scope with several registers (10) during a long period (1h)

Documentation

Pending

@ghost ghost requested review from GullinBustin, MartinALL91 and rjuanpere August 8, 2023 10:03
@ghost ghost self-assigned this Aug 8, 2023
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