apple燎原火 2023-02-22 10:04 采纳率: 0%
浏览 28

ethercat从站缺少邮箱通信导致配置失败

ethercat: igh主站在配置没有邮箱通信的从站时配置失败,这种情况该怎么解决?

从站扫描结果:
/* 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输出异常,不受控
  • 写回答

1条回答 默认 最新

  • 王大师王文峰 企业官方账号 2023-02-22 10:33
    关注

    检查从站的配置是否正确,检查从站的网络连接是否正常看看吧
    望采纳

    评论

报告相同问题?

问题事件

  • 创建了问题 2月22日

悬赏问题

  • ¥100 求Web版SPC控制图程序包调式
  • ¥20 指导如何跑通以下两个Github代码
  • ¥15 大家知道这个后备文件怎么删吗,为啥这些文件我只看到一份,没有后备呀
  • ¥15 C++为什么这个代码没报错运行不出来啊
  • ¥15 一道ban了很多东西的pyjail题
  • ¥15 关于#r语言#的问题:如何将生成的四幅图排在一起,且对变量的赋值进行更改,让组合的图漂亮、美观@(相关搜索:森林图)
  • ¥15 C++识别堆叠物体异常
  • ¥15 微软硬件驱动认证账号申请
  • ¥15 GPT写作提示指令词
  • ¥20 根据动态演化博弈支付矩阵完成复制动态方程求解和演化相图分析等