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.

How is Demo_allication being called?

Other Parts Discussed in Thread: SYSBIOS

Hi,

In the example, C:\ti\sysbios_ind_sdk_2.1.1.2\sdk\examples\ethercat_slave, pSlaveInterface is declared as extern pEACT_SLAVE_INTERFACE (line 68 in tiescappl.c).

In lines 147-148 of tiescutils.c,

//assign application function pointer

pSlaveInterface->pApplication = (void (*)(void))&Demo_Application;

pSlaveInterface->pStateTrans = &Demo_StateTrans;


Apart from those places, I can't see anywhere else where pSlaveInterface appears or is called in those files either explicitly or implicitly.

However, Demo_Apllication is called periodically. From the debugger, it can be seen that task1()->MainLoop()->APPL_Application()->Demo_Application(). There is no description about what MainLoop() and APPL_Application are and how to use them although the source code of those third party functions is not available.


Please provide more information about how Demo_Application() and Demo_StateTrans() are called.


Many thanks

  • The title should be "How is Demo_application being called?
  • The missing source code here is the EtherCAT slave sample code that is available from ETG/Beckhoff for free. You just need to be a member of ETG which is a must for EtherCAT work anyway. It is free too...
  • Thanks Frank.

    I can see that they are called initially by Ecat_OnTimer(). From the document, PRU ICSS EtherCAT firmware API Guide, it invokes Beckhoff SSC main stack processing function. Then the Beckhoff SSC main function calls Demo_Application() and Demo_StateTrans(). I believe that Sync0task() and Sync1task() are used for ESC (DC)Sync. Is that correct?

    Form EtherCATSampleLibrary.h, there are only two variables, i.e. unsigned long *pInput and unsigned long pOutput. Can the *pECAT_SLAVE_INTERFACE be declared differently such as including more variables? Where can I find the specification of ECAT_SLAVE_INTERFACE (which I believe belongs to TI)?

    Kind regards,

    Bailin