Check whether the configuration of the slave station is correct, check whether the network connection of the slave station is normal look at
Hope to accept
ethercat: igh master station failed to configure a slave station without email communication. How can I solve the situation?
从站扫描结果:
/* Master 0, Slave 0, "Smartind 64 DO Module (NPN Output Type)"
* Vendor ID: 0x00999999
* Product code: 0x00010005
* Revision number: 0x20200824
*/
ec_pdo_entry_info_t slave_0_pdo_entries[] = {
{0x7000, 0x01, 8}, /* Output Channel 1 */
{0x7000, 0x02, 8}, /* Output Channel 2 */
{0x7000, 0x03, 8}, /* Output Channel 3 */
{0x7000, 0x04, 8}, /* Output Channel 4 */
{0x7000, 0x05, 8}, /* Output Channel 5 */
{0x7000, 0x06, 8}, /* Output Channel 6 */
{0x7000, 0x07, 8}, /* Output Channel 7 */
{0x7000, 0x08, 8}, /* Output Channel 8 */
{0x6000, 0x01, 8}, /* Setting 1 */
{0x6000, 0x02, 8}, /* Setting 2 */
};
ec_pdo_info_t slave_0_pdos[] = {
{0x1600, 8, slave_0_pdo_entries + 0}, /* DO Channel */
{0x1a00, 2, slave_0_pdo_entries + 8}, /* Reserved */
};
ec_sync_info_t slave_0_syncs[] = {
{0, EC_DIR_OUTPUT, 1, slave_0_pdos + 0, EC_WD_ENABLE},
{1, EC_DIR_INPUT, 1, slave_0_pdos + 1, EC_WD_DISABLE},
{0xff}
};
配置操作:
case 0x00010005://DG_Smartind
{
int ret = ecrt_slave_config_pdos(sc[i], EC_END, slave_Smartind_syncs); //注册pdo
if (!ret) {
printf("config DG_Smartind pdos %d sucessed\n", i);
} else continue;
ec_pdo_entry_reg_t domain1_DG_Smartind[] = {
{0, i, DG_Smartind, 0x7000, 0x01, &offset_Smartind[i][0], NULL},//out1-8
{0, i, DG_Smartind, 0x7000, 0x02, &offset_Smartind[i][1], NULL},//out9-16
{0, i, DG_Smartind, 0x7000, 0x03, &offset_Smartind[i][2], NULL},//out1
{0, i, DG_Smartind, 0x7000, 0x04, &offset_Smartind[i][3], NULL},//out1
{0, i, DG_Smartind, 0x7000, 0x05, &offset_Smartind[i][4], NULL},//out1
{0, i, DG_Smartind, 0x7000, 0x06, &offset_Smartind[i][5], NULL},//out1
{0, i, DG_Smartind, 0x7000, 0x07, &offset_Smartind[i][6], NULL},//out1
{0, i, DG_Smartind, 0x7000, 0x08, &offset_Smartind[i][7], NULL},//out57-64
{0, i, DG_Smartind, 0x6000, 0x01, &offset_Smartind[i][8], NULL},//setting1
{0, i, DG_Smartind, 0x6000, 0x02, &offset_Smartind[i][9], NULL},//setting2
};
ret = ecrt_domain_reg_pdo_entry_list(domain1, domain1_DG_Smartind);//注册pdo entry
printf("ret: %d\n", ret);//ret = -2
if (!ret) {
printf("DG_Smartind %d : %#x\n", i, offset_Smartind[i][0]);
} else continue;
ecrt_slave_config_dc(sc[i], 0x0300, 1000000, 300000, 0, 0); //temp
}break;
出现的结果:
Slave 0 : config DG_Smartind pdos 0 sucessed
Failed to register PDO entry: No such file or directory
ret: -2
从站的现象:
从站io输出异常,不受控
0 Answer
Check whether the configuration of the slave station is correct, check whether the network connection of the slave station is normal look at
Hope to accept
这家伙很懒,什么都没留下...