This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software:
In this example file, I am using the CPU1 echoback solution( ~\ti\c2000\C2000Ware<version>\libraries\communications\Ethercat\f2838x\examples), but I am curious about how to integrate my main code into this example file.
In conclusion, I want to integrate my existing controller code into this example file.
Additionally, when using this example file to establish EtherCAT communication with TwinCAT3, I fill in the necessary files using the SSC tool. I am wondering if I need to modify any .c or .h files after performing this task.
Thank you.
Hi,
In the SSC tool view, you have the option of modifying the example source files. You can add/reload files containing your controller code and then generate the necessary files using the SSC tool.
Thanks.
Thank you for your response. However, the problem I am unable to solve is how to integrate the example files generated by the SSC tool with the files I usually use. As far as I know, the SSC tool only generates source files related to communication.
As shown in the image above, SSC tool can also be used to generate (essentially, copy) example specific files. The simplest way to do that is to open the SSC tool, click Add File(s).
Thanks.
Thank you. I will try to follow the method you suggested. However, my concern is that when I tried a similar method before, I encountered many errors in the header files.
Thank you for your continued attention and support.
The most common errors I encountered were due to duplicate function declarations. I tried to resolve them, but the C code was too complex and interrelated for me to fix.
The method I want to use is as follows: For example, I have gpio.h and gpio.c files, but instead of using these, I want to use f2838x_gpio.h and f2838x_gpio.c files to write my main code. However, I am unsure how to integrate these files into the EtherCAT example project.
In short, I don't know how to integrate my main code, written based on the f2838x, into the EtherCAT example project.
Hi,
gpio.c and gpio.h are GPIO driver files. Does your application need to replace any of the driver functions in the implementation? What kind of changes are you expecting to make in the application? Please let us know so that we can advise accordingly.
Thanks.
It's not so much about replacing as it is about using the gpio.c and gpio.h files for the EtherCAT communication files, and using the F2838x_gpio.h and F2838x_gpio.c files in the main function.
Thanks.
Hi,
Apologies for the delayed response. Could you please elaborate on your issue, in case it is still unresolved?
Thanks.