Hello,
I am using:
Industrial Comm SDK 09.00.00.35
EtherCAT-Stack: Full Stack from TI
In my application I have a problem with the number / size of TXPDOs needed. I also reproduced in example project.
Here is what I am trying:
- I have multiple different TX PDOs
- The TX PDOs can have different sizes
- Not all TX PDOs are possible at once, the usage of some PDOs excludes/disallows the usage of other PDOs
- I can model this by rejecting the assignment I get
- And also by adding some "Exclude"-Entries in the ESI file
What's not working in the stack:
- As soon as the sum of all possible TX PDOs is greater than 256 Bytes, the stack init fails with 0x38010015 (EC_API_eERR_TX_PROC_IMG_OVERFLOW)
- It seems like the stack cannot understand that not all PDOs will be active at once and "thinks" that activating all will lead to overflow
What i tried to do:
- increasing EC_MBXIN_DEF_LENGTH in projects.h to 1024, but this didn't help
- after creating the PDOs and before Slave init, disabling the TX PDOs via EC_API_SLV_PDO_disable()
Here is some code I to reproduce in example
for creating the records in EC_SLV_APP_SS_populateInOutObjects()
// create a dummy test object with many subentries char subindex_name[16] = "\0"; for (int i = 0; i < 4; i++) { EC_API_SLV_SCoE_Object_t* p_coe_object = NULL; error = (EC_API_EError_t)EC_API_SLV_CoE_odAddRecord(ptSlave, 0x2030 + i, "64 Byte Test Record", NULL, NULL, NULL, NULL, &p_coe_object); for(int j = 1; j <= 64; j++) { snprintf(subindex_name, sizeof(subindex_name), "SubIndex %d", j); error = (EC_API_EError_t)EC_API_SLV_CoE_configRecordSubIndex(ptSlave, p_coe_object, j, subindex_name, DEFTYPE_UNSIGNED32, 32, ACCESS_READWRITE | OBJACCESS_TXPDOMAPPING); } }
for mapping them in EC_SLV_APP_SS_populateTxPDO()
// create multiple TX PDOs char subindex_name[16] = "\0"; char txpdo_name[16] = "\0"; // for (int i = 0; i < 3; i++) // this loop will work as sum of all TXPDOs < 256 Byte then for (int i = 0; i < 4; i++) { EC_API_SLV_Pdo_t* ptTxPdo = NULL; snprintf(txpdo_name, sizeof(txpdo_name), "TXPDO%d", 4+i); error = (EC_API_EError_t)EC_API_SLV_PDO_create(ptSlave, txpdo_name, 0x1A04 + i, &ptTxPdo); EC_API_SLV_PDO_disable(ptSlave, ptTxPdo); for(int j = 1; j <= 64; j++) { snprintf(subindex_name, sizeof(subindex_name), "SubIndex %d", j); error = (EC_API_EError_t)EC_API_SLV_CoE_getObjectEntry(ptSlave, 0x2030 + i, j, &ptObjEntry); error = (EC_API_EError_t)EC_API_SLV_PDO_createEntry(ptSlave, ptTxPdo, subindex_name, ptObjEntry); } }
Is there any solution / workaround to create multiple TX PDOs, when the sum >= 256 Byte
Thanks in advance for any help!