步骤(1)和(2)在SOEM源码中对应的实现函数为ecx_readeeprom1()。 步骤(3)和(4)在SOEM源码中对应的实现函数为ecx_readeeprom2()。 ec_config_init 获取连接的从站个数,获取从站的信息并将从站的信息填充到ec_slave结构体 ec_config_map SOEM通过函数ec_config_map(&IOmap)完成逻辑地址和物理地址的映射,应用...
*/ void process_data_config() { int size = 2; u8_t b; uint16_t w,ind; uint32_t dw; for(int slave = 1; slave <= *ecx_context.slavecount; slave++) { //rpdo--- //1c12.0 b = 0; ec_SDOwrite(slave, 0x1c12, 0x00, FALSE, sizeof(b), &b, EC_TIMEOUTRXM); w = ht...
ecx_eeprom2pdi(context, slave); /* set Eeprom control to PDI */ /* schnick - 27.12.2017 - fixed * SAFE_OP disabled after finish ec_config_map(), do it yourself * EL5101 can't config DCSYNC0 in SAFE_OP */ **// ecx_FPWRw(context->port, configadr, ECT_REG_ALCTL, htoes(EC_...
if (ecx_config_init(context, FALSE) <= 0) { printf("no slaves found\n"); return FALSE; } printf("%d slaves found\n", fieldbus->slavecount);printf("Sequential mapping of I/O... "); ecx_config_map_group(context, fieldbus->map, fieldbus->group); ...
[1].blockLRW = 1; ecx_context.grouplist[0].blockLRW = 1; // Configure Distributed Clocks ec_configdc(); ec_dcsync0(1, TRUE, 1000000U, 0); // Configure IOMAP ec_config_map(&IOmap); // TI suggested work-around; // set the system time delay to 1...
VendorID在EEPROM中的地址为0x000a,在/soem/EtheratConfig.c文件中,函数ecx_config_init()读取VendorID的代码如下: for(slave =1; slave <= *(context->slavecount); slave++) { context->slavelist[slave].eep_man = etohl(ecx_readeeprom2(context, slave, EC_TIMEOUTEEP));/* Manuf */ ...
ec_config_init还会为支持它的从站设置邮箱。 当ec_config_init完成时,它将请求所有从站声明PRE_OP。 读取和配置的所有数据都存储在全局数组中,该数组充当键值的占位符,有关详细信息,请参阅ec_slave。 /* find and auto-config slaves */ if (ec_config_init(FALSE) > 0 ) ...
if (ecx_config_init(context, FALSE) <= 0) { printf("no slaves found\n"); return FALSE; } printf("%d slaves found\n", fieldbus->slavecount);printf("Sequential mapping of I/O... "); ecx_config_map_group(context, fieldbus->map, fieldbus->group); ...
36 changes: 30 additions & 6 deletions36soem/ethercatconfig.c Original file line numberDiff line numberDiff line change Expand Up@@ -589,8 +589,16 @@ int ecx_config_init(ecx_contextt *context, uint8 usetable) } /* some slaves need eeprom available to PDI in init->preop transition *...
ec_config(uint8 usetable, void *pIOmap); int ec_config_overlap(uint8 usetable, void *pIOmap); int ec_recover_slave(uint16 slave, int timeout); int ec_reconfig_slave(uint16 slave, int timeout); #endif int ecx_config_init(ecx_contextt *context, uint8 usetable); int ecx_config_map...