EtherCAT SubDevice
 
Loading...
Searching...
No Matches
FSoE PDO Mapping

FSoE data consist of safe data sections of maximum 16 bits and then CRC sections of 16 bits. If a safe data variable is greater than 16 bits then it must be split in two or more data blocks.

As an example, a PDO mapping of a 56-Bit Variable object (e.g. Safety Position) should look like the following table:

Index SubIndex Bit length Name Comment
0x2200 0 16 Safety Position First two byte data chunk
0x6000 1 16 CRC - 0 Checksum
0x0000 0 16 CRC - 1 Second two byte data chunk
0x6000 1 16 CRC - 0 Checksum
0x0000 0 16 CRC - 2 Third two byte data chunk
0x6000 1 16 CRC - 0 Checksum
0x0000 0 8 CRC - 0 Fourth byte data chunk
0x6000 1 16 CRC - 3 Checksum

For a more detailed overview please refer to the ETG5120 FSoE Protocol enhancements document. In the chapter 5.3.3 "Splitting information in PDO Mapping"

Mapping FSoE object

To map safe objects to the process data, the object must contain at least one of these safe flags defined in ecSlvApiDef_CoE.h.

#define OBJACCESS_SAFEINPUTS 0x0400
#define OBJACCESS_SAFEOUTPUTS 0x0800
#define OBJACCESS_SAFEPARAMETER 0x1000

For mapping an object larger than 16 bits, we have to call the PDO create entry function for each 2 byte data blocks. In the example below, we call the CRC mapping too.

EC_API_SLV_PDO_create(pSlave, "RxPDO", 0x1600, &pRxPdo1600);
//Map first two bytes
EC_API_SLV_CoE_getObjectEntry(pSlave, 0x2200, 0, &pPositionEntry);
EC_API_SLV_PDO_createEntry(pSlave, pRxPdo1600, "Safety Position", pPositionEntry);
//Map first CRC
EC_API_SLV_CoE_getObjectEntry(pSlave, 0x6000, 1, &pCRCEntry);
EC_API_SLV_PDO_createEntry(pSlave, pRxPdo1600,"CRC 0", pCRCEntry);
//Map second two bytes
EC_API_SLV_PDO_createEntry(pSlave, pRxPdo1600, "Safety Position", pPositionEntry);
//Map second CRC
EC_API_SLV_CoE_getObjectEntry(pSlave, 0x6000, 2, &pCRCEntry);
EC_API_SLV_PDO_createEntry(pSlave, pRxPdo1600, "CRC 1", pCRCEntry);
//Map third two bytes
EC_API_SLV_PDO_createEntry(pSlave, pRxPdo1600, "Safety Position", pPositionEntry);
//Map third CRC
EC_API_SLV_CoE_getObjectEntry(pSlave, 0x6000, 3, &pCRCEntry);
EC_API_SLV_PDO_createEntry(pSlave, pRxPdo1600, "CRC 2", pCRCEntry);
//Map last data chunk
EC_API_SLV_PDO_createEntry(pSlave, pRxPdo1600, "Safety Position", pPositionEntry);
//Map fourth CRC
EC_API_SLV_CoE_getObjectEntry(pSlave, 0x6000, 4, &pCRCEntry);
EC_API_SLV_PDO_createEntry(pSlave, pRxPdo1600, "CRC 3", pCRCEntry);
uint32_t EC_API_SLV_CoE_getObjectEntry(EC_API_SLV_SHandle_t *pHandle, uint16_t index, uint8_t subIndex, EC_API_SLV_SCoE_ObjEntry_t **ppObjectEntry)
This function returns object entries from the Object Dictionary.
Definition ecSlvApi_CoE.c:661
uint32_t EC_API_SLV_PDO_create(EC_API_SLV_SHandle_t *pHandle, char *pName, uint16_t mapIndex, EC_API_SLV_Pdo_t **pOutPdo)
Creates an empty PDO.
Definition ecSlvApi_pdo.c:416
uint32_t EC_API_SLV_PDO_createEntry(EC_API_SLV_SHandle_t *pHandle, EC_API_SLV_Pdo_t *pPdo, char *pName, EC_API_SLV_SCoE_ObjEntry_t *pObjEntry)
This function maps an object entry from the Object Dictionary as a PDO.
Definition ecSlvApi_pdo.c:827

RxPDO object in TwinCAT

The below diagram shows the RxPDO object in the CoE online tab in TwinCAT. The safety position object is split into multiple data chunks, filled with CRC data in between.

FSoE mapping in TwinCAT

The below diagram shows the RxPDO object in the process data tab in TwinCAT.

Process data object content view in TwinCAT