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

Entirely simulated slave device under Linux #182

Open
lanouettea opened this issue Apr 30, 2024 · 2 comments
Open

Entirely simulated slave device under Linux #182

lanouettea opened this issue Apr 30, 2024 · 2 comments

Comments

@lanouettea
Copy link

In our hardware solution, we use a motor drive that is controlled via Ethercat. A PC acts as the master using the SOEM library and communicates with the drive.

To test our software stack, we have simulators for most of our hardware. This allows us to perform end to end testing of our products from our CI system and to develop more efficiently by simulating the hardware on developer PCs. However, we are struggling to find a way to simulate an Ethercat device. We already have all the logic to control a simulated motor drive and all the logic to send data to the Ethercat device from our software using SOEM, but we cannot figure out how to implement a simulated Ethercat slave.

We are wondering if SOES could be used to achieve this. The simulated hardware will never end up in the final product. We believe we should be able to create 2 virtual network interfaces (one for the master, one for the slave) and bridge them together. We cannot figure out how to actually use that virtual network interface to send and receive data from SOES or if it is even possible.

Any help or pointer to the right direction would be greatly appreciated.

Thanks!

@nakarlsson
Copy link
Contributor

nakarlsson commented May 1, 2024

It is possible to get something running.
In another project we did something similar, the trick is to decode the frame on the SOES side, but that is not that difficult, in the end the frames are only different ways to access the memory of the slave and to generate the event needed.

The input to SOES is ESC memory registers, and you would need to emulate the PDI IRQs that triggers state changes, update SMs and so on.

@maximekli
Copy link

Hi @lanouettea, very interested on that subject as well, any success on your side?

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

No branches or pull requests

3 participants