EtherCAT Slave  1.06.01
Configuration of the Process Data

Process Data is exchanged cyclically with the EtherCAT Master. Process Data Objects (PDO) are objects from the object dictionary mapped as process data. Therefore, the object dictionary must be configured before configuring the process data objects.

PDO configuration example

A PDO is an object filled with PDO entries. These entries are objects from the object dictionary which can be mapped as PDO. Therefore, there are few things to consider.

Therefore, it's not possible to map an object only with OBJACCESS_RXPDOMAPPING flag in a PDO with Index 0x1A00 to 0x1BFF and vice versa.

Examples

Create a RxPDO and map an entry from array object entry from CoE Examples to the PDO.

EC_API_SLV_SHandle_t* ptSlave = pApplicationInstance_p->ptEcSlvApi;
EC_API_SLV_SCoE_ObjEntry_t* ptObjEntry = NULL;
EC_API_SLV_SPdo_t* ptRxPdo1600 = NULL;
error = (EC_API_EError_t)EC_API_SLV_PDO_create(ptSlave, "RxPDO", 0x1600, &ptRxPdo1600);
error = (EC_API_EError_t)EC_API_SLV_CoE_getObjectEntry(ptSlave, 0x2100, 1, &ptObjEntry);
error = (EC_API_EError_t)EC_API_SLV_PDO_createEntry(ptSlave, ptRxPdo1600, "SubIndex 001", ptObjEntry);

Help functions

The EtherCAT SDK provides with a set of functions to access the process data. These help functions are available with the PDO suffix. For further information please refer to the documentation.

Function Description
EC_API_SLV_PDO_get Get object from PDO list
EC_API_SLV_PDO_getOffset Get PDO offset in process data
EC_API_SLV_PDO_getLength Get PDO length
EC_API_SLV_getInputProcDataLength Get input process data length
EC_API_SLV_getOutputProcDataLength Get output process data length
EC_API_SLV_PDO_getEntryCount Get PDO entry count
EC_API_SLV_PDO_getEntryDataLength Get entry data length
EC_API_SLV_setInputData Write input process data
EC_API_SLV_getOutputData Read output process data
EC_API_SLV_PDO_setData Set PDO data
EC_API_SLV_PDO_getData Get PDO data
EC_API_SLV_PDO_setEntryData Set PDO entry data
EC_API_SLV_PDO_getEntryData Get PDO entry data
EC_API_SLV_PDO_setFixedMapping Define if PDO entries adjustable or not
EC_API_SLV_PDO_enable Enable PDO from process data mapping
EC_API_SLV_PDO_disable Disable PDO from process data mapping
EC_API_SLV_PDO_enabled Check PDO status
EC_API_SLV_PDO_setAssignment Define if SyncManager content is adjustable or not
EC_API_SLV_PDO_addPadding Add padding to process data to avoid alignment issues
EC_API_SLV_CoE_getObjectEntry
uint32_t EC_API_SLV_CoE_getObjectEntry(EC_API_SLV_SHandle_t *pEcSlaveApi_p, uint16_t index_p, uint8_t subIndex_p, EC_API_SLV_SCoE_ObjEntry_t **ppObjectEntry_p)
This function returns object entries from the Object Dictionary.
Definition: ecSlvApi_CoEStub.c:325
EC_API_EError_t
enum EC_API_EError EC_API_EError_t
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_SPdo_t
struct EC_API_SLV_SPdo EC_API_SLV_SPdo_t
TPdo is used to describe the RxPDOs and TxPDOs.
Definition: ecSlvApi.h:126
EC_API_eERR_INVALID
@ EC_API_eERR_INVALID
Definition: ecApiError.h:73
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
EC_API_SLV_SCoE_ObjEntry_t
struct EC_API_SLV_SCoE_ObjEntry EC_API_SLV_SCoE_ObjEntry_t
TSdoEntry describes an OBD Object Entry.
Definition: ecSlvApi.h:129
EC_API_SLV_PDO_createEntry
uint32_t EC_API_SLV_PDO_createEntry(EC_API_SLV_SHandle_t *pEcSlaveApi_p, EC_API_SLV_SPdo_t *pPdo_p, char *pName_p, EC_API_SLV_SCoE_ObjEntry_t *pObjectEntry_p)
This function maps an object entry from the Object Dictionary as a PDO.
Definition: ecSlvApi_ProcDataStub.c:270