FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
09-23-2024 11:59 AM
I have a project with a sensor that is connected via EtherCat. In general it works like this: You send a request to the sensor and it responds.
I use the EtherCat app to do this and send a request to Transmit_data.Value and get a response via Receive_data.Value. The problem is that the two nodes are of the byte array type and this is not displayed properly in the data layer, which is why I had to think outside the box:
getMemoryMap reads the MemoryMap and writeByteArray overwrites the Transmit_data.Value node
I then created two nodes, one to request the name of the sensor with a bool and one node for the output. When the node is triggered, the function handleTransmitReadDeviceName is called which then overwrites the Transmit_data.Value with the corresponding byte array and then executes the handshake(processNodes).
In the processAndWriteToNodes function, the response of the sensor and the expected byte sequence is compared and if this matches, the output node I created is overwritten. The function runs permanently
This all works pretty well, but I have a problem: A time waster must have crept in somewhere during the output process, but I can't find it. The output process usually takes 3-4 seconds on average, but sometimes within milliseconds. How could I approach this problem
Thanks in advance
09-24-2024 06:21 PM
This probably needs to be looked at in more detail.
09-24-2024 07:16 PM
I might be facing a similar issue in the codesys version as well I am doing a similar task reading the memory map of the ethercat and saw my time to retrieve go from a fews ms to at least 100s of ms (or just a few ms again in some cases). It seems to be maybe related to the content or content length of the ethercat map. When adding a Safex Controller to the system that's when I found I had an issue.
This leads me to think the issue might be related to the Datalayer or Ethercat application.
09-25-2024 08:55 AM
Thanks for the reply.
I can send you my whole project via private message, if you want.
09-25-2024 01:10 PM
Hi Folks,
to get the real time data in a consitent way, you have to do it in a real time capable way and language.
With the codesys PLC you can do it using the Datalayer Node in the ctrlX PLC Engineering, and running your task synchronized to the EtherCAT Master.
Here an example picture:
Have you seen this? Collection-of-how-to-videos-blogs-and-examples-for-ctrlX/ba-p/12343#toc-hId-1976839065
If you do your own C/C++ app you have to write a real time bundle.
For more information about real time bundles and SDK please get in touch with your responsible sales/support.
Regards