EtherCAT Slave
 
Loading...
Searching...
No Matches
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);
@ EC_API_eERR_INVALID
Definition ecSlvApi_Error.h:52
enum EC_API_EError EC_API_EError_t
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:420
uint32_t EC_API_SLV_PDO_createEntry(EC_API_SLV_SHandle_t *pEcSlaveApi_p, EC_API_SLV_Pdo_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:268
uint32_t EC_API_SLV_PDO_create(EC_API_SLV_SHandle_t *pEcSlaveApi_p, char *pName_p, uint16_t mapIndex_p, EC_API_SLV_Pdo_t **pOutPdo_p)
Creates an empty PDO.
Definition ecSlvApi_ProcDataStub.c:67
struct EC_API_SLV_CoE_ObjEntry EC_API_SLV_SCoE_ObjEntry_t
TSdoEntry describes an OBD Object Entry.
Definition ecSlvApi.h:130
struct EC_API_SLV_Handle EC_API_SLV_SHandle_t
EC_API_SLV_SHandle_t describes the EtherCAT Slave API.
Definition ecSlvApi.h:136

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_setFixed 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_PDO_registerAssignmentChanges Process data reconfiguration after change on SyncManager assignments
EC_API_SLV_PDO_registerMappingChanges Process data reconfiguration after changes on PDO mapping
EC_API_SLV_PDO_getMappingInfo Get PDO mapping information
EC_API_SLV_PDO_getAssignmentInfo Get SyncManager assignment information
EC_API_SLV_PDO_setMaxSubIndex Set maximum subIndex for unfixed PDOs
EC_API_SLV_PDO_setSyncManMaxSubIndex Set SyncManager maximum subIndex if assignment is allowed