EtherCAT SubDevice2.03.00
 
Loading...
Searching...
No Matches
SyncManager configuration

The SyncManagers are configured automatically by the SDK. However, the default configuration can be changed.

The SDK configures the SyncManagers without permitting the PDO assignments. However, to set it explicitly, use the following code.

EC_API_SLV_PDO_setAssignment(pAppInstance_p->ptEcSlvApi, false);
uint32_t EC_API_SLV_PDO_setAssignment(EC_API_SLV_SHandle_t *pHandle, bool assignment)
Enable or disable PDO assignments of the SyncManagers. Download of PDO assignment (e....
Definition ecSlvApi_pdo.c:1870

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

SyncManager 0x1C12 and 0x1C13 with RO access

Moreover, the PDOs are not possible to be assigned to the SyncManagers. Notice that the SyncManagers contain the 'F' character, which means that they are fixed.

Assignment settings are fixed

Configure SyncManager Assignment

To permit changes on the SyncManager PDO assignment, use the following code.

EC_API_SLV_PDO_setAssignment(pAppInstance_p->ptEcSlvApi, true);

As a result, the SyncManager objects are flagged now as Read Write.

SyncManager 0x1C12 and 0x1C13 with RW access

Therefore, the PDOs are possible to be assigned to the SyncManagers and notice that the fixed mark is now gone.

Assignment settings

Limit the number of SyncManager subIndexes

It is possible to change the number of permitted SyncManager subIndexes by using the following code. It will permit assignments until a certain limit.

\code{.c}  
EC_API_SLV_PDO_setSyncManMaxSubIndex(pAppInstance_p->ptEcSlvApi, 2, 4);
EC_API_SLV_PDO_setSyncManMaxSubIndex(pAppInstance_p->ptEcSlvApi, 3, 4);
\endcode

SyncManager0/SyncManager1 Mailbox Size

By default the mailbox IN/OUT size is limited to 1024 bytes. Below are the steps to be followed to increase the mailbox IN/OUT size to 2048 bytes as an example.

  • Update the maximum mailbox IN/OUT size in the project.h file.
#define EC_MBXOUT_DEF_LENGTH 2048
#define EC_MBXIN_DEF_LENGTH 2048
  • Update the user memory address of the ESC in ecat_def.h.
#define MAX_PD_WRITE_ADDRESS        0x4FFF
#define MAX_PD_READ_ADDRESS         0x4FFF
// Mailbox Size
#define MAX_MBX_SIZE           0x800
#define MAX_MBX_WRITE_ADDRESS       0x4FFF
#define MAX_MBX_READ_ADDRESS        0x4FFF
  • Update the ESI file.
<Sm DefaultSize="2048" StartAddress="#x1000" ControlByte="#x26" Enable="1">MBoxOut</Sm>
<Sm DefaultSize="2048" StartAddress="#x1800" ControlByte="#x22" Enable="1">MBoxIn</Sm>
<Sm DefaultSize="8" MaxSize="1024" StartAddress="#x2000" ControlByte="#x64" Enable="1">Outputs</Sm>
<Sm DefaultSize="8" MaxSize="1024" StartAddress="#x2c00" ControlByte="#x20" Enable="1">Inputs</Sm>
  • Increase the heap memory size in syscfg if necessary.
  • Refresh the EEPROM/SII information and update the ESI file in EtherCAT MainDevice.
Mailbox Size Update

The default mailbox queue size is set to 10 and the mailbox queue size can be updated using the macro 'MAX_MBX_QUEUE_SIZE' in mailbox.h file. It is possible to update the mailbox queue size dynamically from the application using the API EC_API_SLV_setMaxMbxQueueSize()ℹ️.

‍ℹ️ This feature is part of premium SDK. In case you are using standard and need premium, please contact your regional TI sales representative for additional details.