EtherCAT Slave  1.06.01

◆ EC_API_SLV_PDO_create()

uint32_t EC_API_SLV_PDO_create ( EC_API_SLV_SHandle_t pEcSlaveApi_p,
char *  pName_p,
uint16_t  mapIndex_p,
EC_API_SLV_SPdo_t **  pOutPdo_p 
)

Creates an empty PDO.

PDO must be filled with content. Hence add the entries flagged as PDO mappable from the Object Dictionary

Parameters
[in]pEcSlaveApi_pThe pointer to the EtherCAT API instance.
[in]pName_pThis parameter is the name of the PDO
[in]mapIndex_pThe index number for the mapping object in the Object Dictionary. RxPDO: 0x01600-0x17FF - TxPDO: 0x1A00-0x1BFF
[out]pOutPdo_pThe pointer to the generated PDO instance
Returns
EC_API_EError_t Returns the API error code.
Example
#include <ecSlvApi.h>
// required variables
uint32_t retVal = 0;
EC_API_SLV_SHandle_t* S_ecSlvApiHdl;
TPdo* ptRxPdo1600;
// the Call
retVal = EC_API_SLV_PDO_create(S_ecSlvApiHdl, "RxPDO", 0x1600, &ptRxPdo1600);
Examples
ecSlvCiA402.c.
EC_API_SLV_SHandle_t
struct EC_API_SLV_SHandle EC_API_SLV_SHandle_t
EC_API_SLV_SHandle_t describes the EtherCAT Slave API.
Definition: ecSlvApi.h:135
EC_API_SLV_PDO_create
uint32_t EC_API_SLV_PDO_create(EC_API_SLV_SHandle_t *pEcSlaveApi_p, char *pName_p, uint16_t mapIndex_p, EC_API_SLV_SPdo_t **pOutPdo_p)
Creates an empty PDO.
Definition: ecSlvApi_ProcDataStub.c:86