...
Code Block | ||
---|---|---|
| ||
static const uint8_t s_b2002_NumElements; SUBOBJECT_DESCRIPTION_T g_tSiObj_2002[] = { { .bSubIndex = 0, .bIndicationFlags = 0, .usAccessRights = ECAT_OD_READ_ALL, .usDatatype = ECAT_OD_DTYPE_UNSIGNED8, .ulMaxFieldUnits = 1, .pszName = "Number of elements", .pvInitialValue = &s_b2002_NumElements, .ulInitialValueLength = sizeof(s_b2002_NumElements), }, { .bSubIndex = 1, .bIndicationFlags = 0, .usAccessRights = ECAT_OD_ACCESS_ALL, .usDatatype = ECAT_OD_DTYPE_UNSIGNED8, .ulMaxFieldUnits = 1, .pszName = "Outputdata10", .pvInitialValue = 0, .ulInitialValueLength = 0, }, }; static const uint8_t s_b2002_NumElements = ARRCNT(g_tSiObj_2002) - 1; /* SI 00 does not counts */ |
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;
}
|