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.

LP-AM243: about creating PDO entry after PDO mapping changed

Part Number: LP-AM243

Tool/software:

Hi Team,

I'm developing using "ethercat_slave_demo" of SDK ver.09_02_00_15.

In order to map an object entry from the Object Dictionary as a PDO, 

it might be need to use code like below.

#include <ecSlvApi.h>
 
TPdo *ptRxPdo;
TSdoEntry* ptSdoEntry;
EC_API_SLV_getSdoEntry(ptEcSlvApi, 0x2002, 2, &ptSdoEntry);
EC_API_SLV_PDO_create(ptEcSlvApi, "RxPDO", 0x1600, &ptRxPdo);
EC_API_SLV_PDO_createEntry(ptEcSlvApi, ptRxPdo, ptSdoEntry);

After changed mapping PDO by Master, above process would be done.

However, there is no code in sdk to get PDO Entry and to create .

So, is it need to write this code after PDO changed call back ?

or it already has been build in EtherCAT stack as Binary?    

Best regards,

Oyama

  • Hello Oyama,

    Yes. In order to map the object entry from the Object Dictionary to PDO, follow the steps below.

    1. Create a PDO object by using the API EC_API_SLV_PDO_create().

    2. Get the object entry to be mapped into the PDO entry with the API EC_API_SLV_CoE_getObjectEntry().

    3. Create a PDO entry by mapping the object entry using the API EC_API_SLV_PDO_createEntry().

    Please refer to the function EC_SLV_APP_SS_populateRxPDO() in Simple Demo example, which configures the RxPDOs. 

    Once the EtherCAT master changes the PDO assignments or mappings, the corresponding callbacks are triggered in the EtherCAT slave stack.

    1. As a result of PDO assignment changes, EC_SLAVE_APP_assignmentChangedHandler() is triggered.

    2. As a result of PDO mapping changes, EC_SLAVE_APP_mappingChangedHandler() is triggered.

    Please refer PDO Configuration and PDO Reconfiguration pages in the EtherCAT documentation.

    There is an API EC_API_SLV_PDO_getEntry() to get the PDO entry.

    In the next Industrial Communications SDK release, there shall be a bug fix related to PDO reconfiguration.

    • Fix is - Callback is now triggered when PDOs with padded entries are reconfigured from Master.

    "However, there is no code in sdk to get PDO Entry and to create .

    So, is it need to write this code after PDO changed call back ?

    or it already has been build in EtherCAT stack as Binary?"

    I could not understand this part of the query here.  

    Kind Regards,

  • Hello Harsha,

    After triggered EC_SLAVE_APP_mappingChangedHandler(), it is no need to re-create PDO entry by EC_API_SLV_CoE_getObjectEntry() and  EC_API_SLV_PDO_createEntry().

    But it is need to re-get PDO entry by  EC_API_SLV_PDO_getEntry(), right?

    Best Regards,

    Oyama

  • Hello Oyama,

    Once the EtherCAT master changes the PDO mappings or assignments, the PDO reconfiguration and PDO reassignments will happen within the EtherCAT stack and then the corresponding callback functions are triggered with new configuration details.

    Kind Regards,