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.

AM6442: EtherCAT SubDevice Stack: Specify trigger of application function

Part Number: AM6442


Tool/software:

Hello TI-Team,

I am working with ethercat slave simple demo. (ind_comms_sdk_am64x_09_01_00_03 and CCS 12.5.0.00007) In there the application function EC_SLV_APP_SS_applicationRun (ecSlvSimple.c) is already implemented. But it is not clear to me what triggers this function (Process Data or SYNC0). Is this defined somewhere in the stack and how can I adapt it?

I am aware that this function is registered in ecSlvSimple.c

EC_API_SLV_cbRegisterUserApplicationRun     (pAppInstance_p->ptEcSlvApi, EC_SLV_APP_SS_applicationRun, pAppInstance_p);

But I did not find any parameter that specifies the trigger. Unfortunately I cannot find anything about this in the documentation and also nothing about EC_API_SLV_cbRegisterUserApplicationRun in the API reference.

I appreciate your help.

Regards,
Jonas

  • Hello Jonas,

    The application function EC_SLV_APP_SS_applicationRun() which is registered with EC_API_SLV_cbRegisterUserApplicationRun will be triggered for both Process Data and SYNC0 events. This application function is synchronized to process data Sync Manager event and SYNC0 event.

    Kind Regards,

  • Hello Harsha,

    Thanks for your reply.

    I have two follow-up questions:

    1. Is there a way to determine in which synchronization mode (Process Data, SYNC0, ...) the stack is currently running? This information could be obtained by reading 0x1C32:01 and 0x1C33:01 of the object dictionary (Beckhoff Information System - English). But I wonder if there is also an API-function that returns the synchronization mode.
    2. When application function is synchronized with SyncManager2: Do I have to wait a certain time in EC_SLV_APP_SS_applicationRun() until the outputs (of the master) are updated in the pdBuffer or are they already up to date when EC_SLV_APP_SS_applicationRun() is called?

    Thank you for your time

    Regards,
    Jonas

  • Hello Jonas,

    1. Unfortunately, there is no API implemented in the stack which returns the synchronization mode.

    2. The application function EC_SLV_APP_SS_applicationRun(), when synchronized with process data - SM2, is called after the process data from the EtherCAT master has been updated in the local buffer. Hence, the process data in the pdBuffer is already up to date when EC_SLV_APP_SS_applicationRun() function is called.

    Kind Regards,

  • Hello Harsha,

    Thanks again for your helpful reply, this answers my questions.

    When application function is synchronized with SyncManager2: Do I have to wait a certain time in EC_SLV_APP_SS_applicationRun() until the outputs (of the master) are updated in the pdBuffer or are they already up to date when EC_SLV_APP_SS_applicationRun() is called?

    I was asking this because I noticed something similar to what is described in this thread. But this would be a topic for a new thread.

    Thanks again,
    Jonas