...
That means, if the EtherCAT master writes a sync mangerobject to the ECS slave, the slave application will get this object and it needs to check wtich PDO the EhterCAT master wants and . The Slave applicaton caclulate the new size PDO size .Because of the new 1 Byte 0x1602, add now some code for and uses Ecat_SetIoSizeReq() to tell the stack this.
With the sourcode chages now the application has the PDO 0x1602 with one Byte. I is necessary to change the OD_CalculatePdoOffsets() to support the new PDO 0x1602:
Code Block | ||
---|---|---|
| ||
static uint32_t OD_CalculatePdoOffsets(APP_ECS_DATA_T *ptAppEcsData, APP_DATA_T *ptAppData, ODV3_WRITE_OBJECT_REQ_T* ptPck) { ... switch (ptPck->tData.usIndex) { case 0x1C12: { for (j = 0; j < ECS_NUMBER_OF_RX_SUBINDX_INCL_SUB0; j++) { /* add offset of PDO to list and calculate next offset, * usTotalInpuSize was set to 0 before 1st function call*/ ptAppEcsData->tAssignment.tAssign1C12Temp.OffsetInProcessData[j] = ptAppEcsData->usTotalOutputSize; if (ptAppEcsData->tAssignment.tAssign1C12Temp.SubindexEntry[j] == 0x1600) { /* calculate next offset */ ptAppEcsData->usTotalOutputSize += 6; } else if (ptAppEcsData->tAssignment.tAssign1C12Temp.SubindexEntry[j] == 0x1601) { /* calculate next offset */ ptAppEcsData->usTotalOutputSize += 4; } else if (ptAppEcsData->tAssignment.tAssign1C12Temp.SubindexEntry[j] == 0x1602) { /* calculate next offset */ ptAppEcsData->usTotalOutputSize += 1; } } ... } break; ... } return lRet; } |
...
go to file AppECS_DemoApplication.h and change the ECS_NUMBER_OF_RX_SUBINDX_INCL_SUB0 for 3 to 4.
Code Block | ||
---|---|---|
| ||
#define ECS_NUMBER_OF_RX_SUBINDX_INCL_SUB0 4 |
...