I am working on a chip which is supposed to be functional as a slave for a PLC (master) through an EtherCAT connection. The chip includes an Atmega2560 and a LAN9252, which is the EtherCAT slave controller.
I have written the xml ESI file. By flashing this ESI on the Slave, I face the following problem:
The Slave works (based on how it is supposed to work) in Config mode of the PLC. The Data is sent from slave to master and also recieved from master into slave. But by starting the Run mode, I get the following error and warning:
810 ms | 'TcSysSrv' (10000): Sending ams command >> Init16\IO: Set State TComObj SAFEOP OP: Device Gerät 2 (EtherCAT Slave) (set to OP)AdsWarning: 1803 (0x70b, NoString) << failed!
793 ms | 'TCOM Server' (10): SAFEOP to OP of 'Gerät 2 (EtherCAT Slave)' (0x03010020) failed - 'invalid parameter' 0x9811070B
Here it is stated that the error is: DeviceInavlidParam : (Invalid parameter value(s).Error code: 1803(0x70b).
I tried to find out what it means and which parameter it is pointing to, so I can modify it. but I am not really able to understand it.
My question is, first, why the ESI Implementation seems to be done in Config mode and it works. But not in the Run mode. What is the difference which brings up the error?
And secondly maybe somebody has seen this kind of error and could kindly help me with it or lead me to a documentation where I can continue with?
Thank you in advance. And please let me know if for an answer some data is needed and by edit or in comment I can provide it.
CodePudding user response:
So after talking with EtherCAT support, I understood that the problem is not from the master side and this error reffers to EtherCAT Slave in device tree. One should remove it or deactivate it, if it is not being used in the project, which was my case.
But the run mode Problem still stayed. Support mentioned that, when this happens, it may mean that, the process data are not updated in Run Mode, as in PREOP state the process data channel is not open yet. So the EtherCAT network needs a trigger from a software real-time task in Run Mode. By following the instructions of part 3.2 of this documnet, the problem will be solved and the slave-master communication is there in Run mode too.
I hope this could be helpful for anybody who faces the same problem in future.