EtherCAT Slave
 
Loading...
Searching...
No Matches
PDO configuration

PDO mapping content can be modified by default. However, it is possible to set the PDO as fixed or unfixed. Notice that this setting is individual for each PDO.

Fixed PDO configuration

To set the PDOs fixed use the following code.

EC_API_SLV_PDO_setFixed(pAppInstance_p->ptEcSlvApi, pAppInstance_p->ptTxPdo1A00, true);
EC_API_SLV_PDO_setFixed(pAppInstance_p->ptEcSlvApi, pAppInstance_p->ptTxPdo1A01, true);
EC_API_SLV_PDO_setFixed(pAppInstance_p->ptEcSlvApi, pAppInstance_p->ptRxPdo1600, true);
EC_API_SLV_PDO_setFixed(pAppInstance_p->ptEcSlvApi, pAppInstance_p->ptRxPdo1601, true);
uint32_t EC_API_SLV_PDO_setFixed(EC_API_SLV_SHandle_t *pEcSlaveApi_p, EC_API_SLV_Pdo_t *pPdo_p, bool fixed_p)
This is the function to set a PDO as fixed or not. Download of PDO Configuration during start up.
Definition ecSlvApi_ProcDataStub.c:521

As a result, the PDO objects are flagged as Read Only.

PDO objects with R0 access
td

Therefore, it is not permitted to change the mapping configuration.

PDO mapping can not be changed
td

Not Fixed PDO configuration

To disable the fixed attribute on the PDOs, use the following code.

EC_API_SLV_PDO_setFixed(pAppInstance_p->ptEcSlvApi, pAppInstance_p->ptTxPdo1A00, false);
EC_API_SLV_PDO_setFixed(pAppInstance_p->ptEcSlvApi, pAppInstance_p->ptTxPdo1A01, false);
EC_API_SLV_PDO_setFixed(pAppInstance_p->ptEcSlvApi, pAppInstance_p->ptRxPdo1600, false);
EC_API_SLV_PDO_setFixed(pAppInstance_p->ptEcSlvApi, pAppInstance_p->ptRxPdo1601, false);

As a result, the PDO objects are flagged as Read Write. Notice that the maximum numbers of subIndexes (254 subIndexes) are defined by default.

PDO objects with RW access
td

Now it is permitted to change the mapping configuration.

PDO mapping can be changed
td
New PDO mapping
td

Limit the number of PDO subIndexes

As seen above, the SDK permits up to 254 subIndexes. In order to reduce the amount of permitted subIndexes, use the following code.

EC_API_SLV_PDO_setMaxSubIndex(pAppInstance_p->ptEcSlvApi, pAppInstance_p->ptTxPdo1A00, 8);
EC_API_SLV_PDO_setMaxSubIndex(pAppInstance_p->ptEcSlvApi, pAppInstance_p->ptTxPdo1A01, 8);
EC_API_SLV_PDO_setMaxSubIndex(pAppInstance_p->ptEcSlvApi, pAppInstance_p->ptRxPdo1600, 8);
EC_API_SLV_PDO_setMaxSubIndex(pAppInstance_p->ptEcSlvApi, pAppInstance_p->ptRxPdo1601, 8);
uint32_t EC_API_SLV_PDO_setMaxSubIndex(EC_API_SLV_SHandle_t *pEcSlaveApi_p, EC_API_SLV_Pdo_t *pPdo_p, uint8_t maxSubIndex_p)
Set Maximum permitted subIndexes for a PDO.
Definition ecSlvApi_ProcDataStub.c:877
New PDO mapping
td