Hilscher Community Forum
communication cycle as EtherCAT slave - Printable Version

+- Hilscher Community Forum (https://forum.hilscher.com)
+-- Forum: netPI 3 - Docker featuring Industrial Raspberry Pi 3 platform (https://forum.hilscher.com/forum-1.html)
+--- Forum: Software (https://forum.hilscher.com/forum-5.html)
+--- Thread: communication cycle as EtherCAT slave (/thread-719.html)

communication cycle as EtherCAT slave - tad - April-15th-2021

Dear Armin,

Once I apply the following container to netPI and make it an EtherCAT slave.

In this case, is it possible to reliably pick up the data coming from the EtherCAT master with a communication cycle of 2ms?
I think the host OS (Linux) on netPI is not a realtime OS so that I can't judge whether netPI can receive the data of 2ms cycle 100% surely.

Thank you very much for your advice.
Best regards,

RE: communication cycle as EtherCAT slave - Armin@netPI - April-15th-2021

Well Tad,

I have never tested it myself how fast the communication over SPI and the netX serial port memory really is but a customer did.

He did the tests with our netHAT module, which is using the same netX51/52 chip type as netPI but is used on top of standard Raspberry PI and also communicates over SPI.

This is the forum where he posted his results: https://forum.hilscher.com/thread-603.html.

He expected latencies < 1msec, but this did not become true in this tests. He was becoming much more jitter. He did a lot of tests ... and finally he used a simple python script to measure the raw Linux SPI function by echoing the SPI-MISO signal to SPI-MOSI signal via a hardware bridge. This excludes the netX chip and its delay since he reads back what is writing by hardware. 

His result was

Quote:This code measure the time of writing and reading 32 bytes through the spi.
And I obtain results between 640us and 1.3ms

So just the raw Linux SPI functions he is using like spi.xfer and spi.readbytes function alone causing such a jitter. And now imagine that for a communication with netX chip (no HW mirroring any more) further jitter is added since netX has to interpret the written SPI command in its processor ... and put the SPI response command back. This is causing additional jitter. So finally as he said in his very first statement he lands in jitter values of 4-5msec.


RE: communication cycle as EtherCAT slave - tad - April-20th-2021

Dear Armin,

Thank you very much for your help.
I discussed about the above with my colleage in Technical department, and then I now understand about the cycle time of EtherCAT under netPI.

Best regards,