As described before, the SyncManager assignment and PDO mapping settings can be changed by the EtherCAT MainDevice during the transition from PreOP to SafeOP.
Register Process Data configuration change callbacks
In order to get notifications of any mapping or assignment change, use the register functions.
uint32_t EC_API_SLV_PDO_registerMappingChanges(EC_API_SLV_SHandle_t *pHandle, EC_API_SLV_PDO_CBMappingChanges_t cbFunc, void *pContext)
Report PDO mapping changes.
Definition ecSlvApi_pdo.c:2879
uint32_t EC_API_SLV_PDO_registerAssignmentChanges(EC_API_SLV_SHandle_t *pHandle, EC_API_SLV_PDO_CBAssignmentChanges_t cbFunc, void *pContext)
Report PDO assignment changes.
Definition ecSlvApi_pdo.c:2837
Apply new configuration to the device
If the process data configuration is changed by the user, to apply those changes, it is necessary to reload the devices in TwinCAT.
Reaload devices button
Reaload devices in menu
Assignment changes callback
If the assignment change setting is enabled and the assignment callback registered, then the SDK informs the application about the changes requested by the MainDevice.
Assignment change callback from SubDevice Simple example
New assignment reflected in the Object Dictionary
Accept or refuse SyncManager assignment changes
The syncManager assignment change request can be refused from the application. To do so, use an error code different to EC_API_eERR_NONE.
{
}
@ EC_API_eERR_ABORT
Definition ecSlvApiDef_error.h:47
Describes the information passed to the PDO assignment change callback.
Definition ecSlvApi_types.h:131
Application refuses to transit to SafeOP and reports an AL Status Code error
PDO changes callback
If the PDO mapping is not fixed and the mapping changes callback registered, then the SDK informs the application about the changes requested by the MainDevice.
Mapping change callback from SubDevice Simple example
New mapping reflected in the Object Dictionary
Accept or refuse PDO mapping changes
The PDO mapping change request can be refused from the application. To do so, use an error code different to EC_API_eERR_NONE.
uint32_t EC_SLAVE_APP_mappingChangedHandler(
void* pContext_p, uint16_t pdoIndex_p, uint8_t count_p,
EC_API_SLV_PDO_SEntryMap_t* pPdoMap_p)
{
}
EC_SLV_API_PDO_SEntryMap_t describes the EtherCAT Slave API.
Definition ecSlvApi_types.h:123
Application refuses to transit to SafeOP and reports an AL Status Code error.