XMC4800 EtherCAT modify Excel process data

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User21308
Level 1
Level 1
First solution authored
Hello,
I'm a student working on my bachelor thesis in electrical engineering. I'm trying to programm the XMC4800 Relax EtherCAT Kit but I'm having some issues with it.
I'm relativly new to programming microcontrollers.
I started implementing the EtherCAT example project and everything worked well with TwinCAT. I also tried renaming some of the original process data, regenerated the slave files and modified the code.
But when I tried to eliminate some of the unused processdata to modify the example for my needs I faced some problems.
After regenerating the slave files and updating the ESI file in TwinCAT it recognises the new slave with it's modified processdata. If I then try to switch into Free Run Mode or Running Mode the slave refuses to go into OP mode and instead goes into SAFEOP.

I have tried to find a solution here in the forum and found some similar problems but non of the solutions helped.

I made sure to update the ESI in the TwinCAT folder and erased the EEPROM with JFlashLite.

Maybe someone faced similar problems here can help me to find my mistake. Do I have to modify anything else in the example?

Thanks in advance,
Ruben

Here is the Excel file if it helps.
4993.attach
0 Likes
1 Solution
User21308
Level 1
Level 1
First solution authored
Thank you for your help.
The missing padding bits where the problem. I added pad_14 after Button2 and pad_13 after State to get a multiple of 16 bits for each input data and output data.
In my opinion this is a problem that the ssc-tool could mention during slave file generation. I think it only shows an error if one entry overlaps a word.

View solution in original post

0 Likes
3 Replies
User15738
Level 1
Level 1
Which error message to you get in the TwinCAT logger? There should be an indication to an error code.
A straight forward solution would then be check where the error code is returned in the code. The error codes are defined in the file ecatslv.h.

Some thoughts on your table which coulds cause the failure.
The process data is not multiple of one byte, I would recommend to add padding bits to process data objects.
Furthermore it could be that the code is configured to check the process data for even 16Bit or 32Bit alignement (defines "CHECK_SM_PARAM_ALIGNMENT", "CONTROLLER_32BIT", "CONTROLLER_16BIT"), in that case more padding bits shall be added.

The syntax for the padding bits (and the table in general) is defined in the SSC application note (https://download.beckhoff.com/download/Document/io/ethercat-development-products/an_et9300_v1i8.pdf)
0 Likes
User21308
Level 1
Level 1
First solution authored
Thank you for your help.
The missing padding bits where the problem. I added pad_14 after Button2 and pad_13 after State to get a multiple of 16 bits for each input data and output data.
In my opinion this is a problem that the ssc-tool could mention during slave file generation. I think it only shows an error if one entry overlaps a word.
0 Likes
User22684
Level 1
Level 1
Well, i got similar issues. Thanks a lot for advice! I can also advise you to pay attention to the best essay writer which I found in one service - it saves a lot of time and the result is always excellent. Also, this scheme above helped me a lot - everything is clear
0 Likes