EtherCAT查找从设备示例

本次使用的是 威科达VC322伺服驱动 和 一个220v三相交流伺服电机。

在电脑上安装vmware虚拟机17,使用linuxcnc_2.9.4-amd64.hybrid.iso镜像文件进行创建安装

教程见《LinuxCNC》

python代码如下:

import pysoem

import ctypes

import time

import logging

import threading

from PySide6.QtCore import Signal,QObject

class EtherCATController(QObject):

interface= "ens33" # 替换为实际网卡名称

def init(self):

self.master.open(self.interface)

if self.master.config_init() > 0:

self.slaves = self.master.slaves

for slave in self.slaves:

logging.info(f"发现从站设备:{slave.name}")

self.master.state = pysoem.OP_STATE

self.master.write_state()

return self

raise RuntimeError("未检测到从站设备")

新建类,并执行init函数后,打印'发现从站设备***' 成功。

注意事项:

1.用网线链接电脑和伺服,需要断开电脑的无线网络

2.把虚拟机里的网络适配器模式改为桥接

相关推荐
ARM|X86+FPGA工业主板厂家2 天前
AI视觉跟随运动控制实战|RK3588 NPU检测+FPGA EtherCAT多轴联动精准跟随方案,适用于半导体视觉对位等
人工智能·fpga开发·硬件工程·ethercat·实时系统
星恒讯工业路由器9 天前
三大工业以太网协议选型对比
网络·物联网·ethercat·profinet·ethernet/ip·工业以太网协议
sibo_yzm16 天前
ECE-583快速打通欧姆龙PLC与Modbus TCP客户端连接
tcp/ip·modbus tcp·工业通信·光伏·ethercat·工业网关·上海泗博
沐多1 个月前
【原创】如何利用网卡TSN硬件特性实现EtherCAT 确定性发帧与 DC 同步?
ethercat·实时性能
沂水弦音1 个月前
软控 EI 系列模块优势与竞品对比分析:面向 EtherCAT 分布式 I/O 的工程选型视角
分布式·制造·工业自动化·ethercat·io模块
北京盟通科技官方账号2 个月前
NVIDIA Jetson 全球生态链分析:acontis(代表产品EC-Master)在机器人 EtherCAT 赛道的硬核价值
人工智能·机器人·ethercat·技术原理·盟通科技·ec-master·acontis
北京盟通科技官方账号2 个月前
Windows如何实现硬实时?LxWin双系统隔离架构深度解析
stm32·嵌入式硬件·具身智能·ethercat·人形机器人·实时系统·windows实时扩展
北京盟通科技官方账号2 个月前
工业 PC 平台 EtherCAT 主站协议栈选型探讨:开源方案与商业级实时架构的工程落地对比
架构·机器人·开源·工控·ethercat·盟通科技·ec-master
CC城子2 个月前
EtherCAT技术栈分析(一)
ethercat