This chapter provides guidance to the developers who want to optimize the access to the process data. The SDK uses by default the process data buffers provided by the Beckhoff Stack if none is provided. The PDO setter and getter functions listed in the PDO Help functions copy the process data from one memory area to another. Those functions have time and performance costs, therefore, the SDK allows to register callbacks to access the customer specific memory areas and enable zero copy behaviour.
Using these functions, the end user can register its own callbacks and handle the process data on its own will. For instance, the customer can implement a triple buffer mechanism in a Dual Port RAM and the SDK will get and set the data from it.
void* DPR_PreSequenceInputProcessData(void* pContext_p, uint32_t i32uLength_p)
{
void* pvPayload = NULL;
pvPayload = (void*) DPR_getBuffer(DPR_eService_GetInputProcessData, i32uLength_p);
return pvPayload;
}
void* DPR_PreSequenceOutputProcessData(void* pContext_p, uint32_t i32uLength_p)
{
void* pvPayload = NULL;
pvPayload = (void*) DPR_getBuffer(DPR_eService_SetOutputProcessData, i32uLength_p);
return pvPayload;
}
void DPR_PostSequenceInputProcessData(void* pContext_p, void* pvBuffer_p, uint32_t i32uLength_p)
{
DPR_setBuffer(DPR_eService_GetInputProcessData, pvBuffer_p, i32uLength_p);
}
void DPR_PostSequenceOutputProcessData(void* pContext_p, void* pvBuffer_p, uint32_t i32uLength_p)
{
DPR_setBuffer(DPR_eService_SetOutputProcessData, pvBuffer_p, i32uLength_p);
}
void EC_API_SLV_cbRegisterPreSeqInputPDBuffer(EC_API_SLV_SHandle_t *pEcSlaveApi_p, void *pContext_p, EC_API_SLV_CBPreSeqInputPD_t cbFunc_p)
This is the function to register a function which gets an external Process data buffer.
Definition: ecSlvApi_ProcDataStub.c:1107
void EC_API_SLV_cbRegisterPostSeqInputPDBuffer(EC_API_SLV_SHandle_t *pEcSlaveApi_p, void *pContext_p, EC_API_SLV_CBPostSeqInputPD_t cbFunc_p)
This is the function to register a function which releases an external Process data buffer.
Definition: ecSlvApi_ProcDataStub.c:1185
void EC_API_SLV_cbRegisterPostSeqOutputPDBuffer(EC_API_SLV_SHandle_t *pEcSlaveApi_p, void *pContext_p, EC_API_SLV_CBPostSeqOutputPD_t cbFunc_p)
This is the function to register a function which releases an external Process data buffer.
Definition: ecSlvApi_ProcDataStub.c:1224
void EC_API_SLV_cbRegisterPreSeqOutputPDBuffer(EC_API_SLV_SHandle_t *pEcSlaveApi_p, void *pContext_p, EC_API_SLV_CBPreSeqOutputPD_t cbFunc_p)
This is the function to register a function which gets an external Process data buffer.
Definition: ecSlvApi_ProcDataStub.c:1146
struct EC_API_SLV_SHandle EC_API_SLV_SHandle_t
EC_API_SLV_SHandle_t describes the EtherCAT Slave API.
Definition: ecSlvApi.h:157