/******************************************************************************
*03 Data types数据类型
*****************************************************************************/
struct ec_master;
typedef struct ec_master ec_master_t; /**< \see ec_master */
struct ec_slave_config;
typedef struct ec_slave_config ec_slave_config_t; /**< \see ec_slave_config */
struct ec_domain;
typedef struct ec_domain ec_domain_t; /**< \see ec_domain */
struct ec_sdo_request;
typedef struct ec_sdo_request ec_sdo_request_t; /**< \see ec_sdo_request. */
struct ec_voe_handler;
typedef struct ec_voe_handler ec_voe_handler_t; /**< \see ec_voe_handler. */
struct ec_reg_request;
typedef struct ec_reg_request ec_reg_request_t; /**< \see ec_sdo_request. */
/*****************************************************************************/
/**01 Master state.
*主站状态
* This is used for the output parameter of ecrt_master_state().
*函数ecrt_master_state()的输出参数
* \see ecrt_master_state().
*/
typedef struct {
unsigned int slaves_responding; /**< Sum of responding slaves on all
Ethernet devices.所有以太网设备上响应slave的总数。 */
unsigned int al_states : 4; /**< Application-layer states of all slaves.所有从站应用层状态
The states are coded in the lower 4 bits.被用低四位进行编码
If a bit is set, it means that at least one如果一位被设置,意味着至少一个
slave in the bus is in the corresponding从站在总线上有响应
state:
- Bit 0: \a INIT
- Bit 1: \a PREOP
- Bit 2: \a SAFEOP
- Bit 3: \a OP */
unsigned int link_up : 1; /**< \a true, if at least one Ethernet link is为真,至少有一个连接连上
up. */
} ec_master_state_t;
/*****************************************************************************/
/**02 Redundant link state.
*冗余链路状态。
* This is used for the output parameter of ecrt_master_link_state().
*这用于ecrt主链接状态()的输出参数。
* \see ecrt_master_link_state().
*/
typedef struct {
unsigned int slaves_responding; /**< Sum of responding slaves on the given
link. */
unsigned int al_states : 4; /**< Application-layer states of the slaves on
the given link. The states are coded in the
lower 4 bits. If a bit is set, it means
that at least one slave in the bus is in the
corresponding state:
- Bit 0: \a INIT
- Bit 1: \a PREOP
- Bit 2: \a SAFEOP
- Bit 3: \a OP */
unsigned int link_up : 1; /**< \a true, if the given Ethernet link is up.
*/
} ec_master_link_state_t;
/*****************************************************************************/
/**03 Slave configuration state.
*从站配置状态
* This is used as an output parameter of ecrt_slave_config_state().
用于函数ecrt_slave_config_state()输出参数
* \see ecrt_slave_config_state().
*/
typedef struct {
unsigned int online : 1; /**< The slave is online. 从站在线*/
unsigned int operational : 1; /**< The slave was brought into \a OP state从站被带入操作状态
using the specified configuration. 使用指定配置*/
unsigned int al_state : 4; /**< The application-layer state of the slave.从站应用层状态
- 1: \a INIT
- 2: \a PREOP
- 4: \a SAFEOP
- 8: \a OP
Note that each state is coded in a different
bit! 注意不同的状态使用不同的位*/
} ec_slave_config_state_t;
/*****************************************************************************/
/**04 Master information.
*主站信息
* This is used as an output parameter of ecrt_master().
*用于函数ecrt_master()输出参数
* \see ecrt_master().
*/
typedef struct {
unsigned int slave_count; /**< Number of slaves in the bus. 总线上从站数*/
unsigned int link_up : 1; /**< \a true, if the network link is up. 为真,一个网络连接上*/
uint8_t scan_busy; /**< \a true, while the master is scanning the bus 为真,主站正在扫描总线*/
uint64_t app_time; /**< Application time. 应用时间*/
} ec_master_info_t;
/*****************************************************************************/
/**05 EtherCAT slave port descriptor.
EherCAT 从站端口描述
*/
typedef enum {
EC_PORT_NOT_IMPLEMENTED, /**< Port is not implemented.端口没有实现 */
EC_PORT_NOT_CONFIGURED, /**< Port is not configured. 端口没有配置*/
EC_PORT_EBUS, /**< Port is an E-Bus.端口是E-Bus */
EC_PORT_MII /**< Port is a MII.端口是 MII */
} ec_slave_port_desc_t;
/*****************************************************************************/
/**06 EtherCAT slave port information.
从站端口信息
*/
typedef struct {
uint8_t link_up; /**< Link detected.检测到连接 */
uint8_t loop_closed; /**< Loop closed.循环关闭 */
uint8_t signal_detected; /**< Detected signal on RX port.在RX端口检测到信号 */
} ec_slave_port_link_t;
/*****************************************************************************/
/**07 Slave information.
*从站信息
* This is used as an output parameter of ecrt_master_get_slave().
*用于函数ecrt_master_get_slave()的输出参数
* \see ecrt_master_get_slave().
*/
typedef struct {
uint16_t position; /**< Offset of the slave in the ring.从站在位置环中的偏移 */
uint32_t vendor_id; /**< Vendor-ID stored on the slave. 存储在从站中的供应商ID*/
uint32_t product_code; /**< Product-Code stored on the slave.存储在从站中的产品代码 */
uint32_t revision_number; /**< Revision-Number stored on the slave. */
uint32_t serial_number; /**< Serial-Number stored on the slave. */
uint16_t alias; /**< The slaves alias if not equal to 0.不等于0时候从站假名 */
int16_t current_on_ebus; /**< Used current in mA. */
struct {
ec_slave_port_desc_t desc; /**< Physical port type. */
ec_slave_port_link_t link; /**< Port link state. */
uint32_t receive_time; /**< Receive time on DC transmission delay
measurement. */
uint16_t next_slave; /**< Ring position of next DC slave on that
port. */
uint32_t delay_to_next_dc; /**< Delay [ns] to next DC slave. */
} ports[EC_MAX_PORTS]; /**< Port information. 端口信息*/
uint8_t al_state; /**< Current state of the slave.从站当前状态 */
uint8_t error_flag; /**< Error flag for that slave.从站错误标志 */
uint8_t sync_count; /**< Number of sync managers.同步管理器数量 */
uint16_t sdo_count; /**< Number of SDOs.SDO数量 */
char name[EC_MAX_STRING_LENGTH]; /**< Name of the slave. 从站名字*/
} ec_slave_info_t;
/*****************************************************************************/
/**08 Domain working counter interpretation.
*域工作计数解释
* This is used in ec_domain_state_t.
*/
typedef enum {
EC_WC_ZERO = 0, /**< No registered process data were exchanged. 没有交换注册的过程数据。*/
EC_WC_INCOMPLETE, /**< Some of the registered process data were一些注册的进程数据被交换
exchanged. */
EC_WC_COMPLETE /**< All registered process data were exchanged. 交换了所有注册的过程数据*/
} ec_wc_state_t;
/*****************************************************************************/
/**09 Domain state.
*域状态
* This is used for the output parameter of ecrt_domain_state().
*/
typedef struct {
unsigned int working_counter; /**< Value of the last working counter. 最后一个工作计数器的值*/
ec_wc_state_t wc_state; /**< Working counter interpretation. 工作计数器的状态*/
unsigned int redundancy_active; /**< Redundant link is in use. 冗余链接正在使用中。*/
} ec_domain_state_t;
/*****************************************************************************/
/**10 Direction type for PDO assignment functions.PDO分配函数的方向类型。
*/
typedef enum {
EC_DIR_INVALID, /**< Invalid direction. Do not use this value.无效的方向。不要使用这个值。”*/
EC_DIR_OUTPUT, /**< Values written by the master. 主站写的值*/
EC_DIR_INPUT, /**< Values read by the master. 主站读的值*/
EC_DIR_COUNT /**< Number of directions. For internal use only. 数量的方向。只供内部使用*/
} ec_direction_t;
/*****************************************************************************/
/**11 Watchdog mode for sync manager configuration.
*同步管理器配置看门狗模式
* Used to specify, if a sync manager's watchdog is to be enabled.
*/
typedef enum {
EC_WD_DEFAULT, /**< Use the default setting of the sync manager.使用默认同步管理器设置 */
EC_WD_ENABLE, /**< Enable the watchdog.使能看门狗 */
EC_WD_DISABLE, /**< Disable the watchdog. 不使能看门狗*/
} ec_watchdog_mode_t;
/*****************************************************************************/
/**12 PDO entry configuration information.
*PDo表项配置信息。
* This is the data type of the \a entries field in ec_pdo_info_t.
*
* \see ecrt_slave_config_pdos().
*/
typedef struct {
uint16_t index; /**< PDO entry index. PDO条目索引*/
uint8_t subindex; /**< PDO entry subindex. PDO条目子索引*/
uint8_t bit_length; /**< Size of the PDO entry in bit. PDO条目按位计算的大小*/
} ec_pdo_entry_info_t;
/*****************************************************************************/
/**13 PDO configuration information.
*PDo配置信息。
* This is the data type of the \a pdos field in ec_sync_info_t.
*
* \see ecrt_slave_config_pdos().
*/
typedef struct {
uint16_t index; /**< PDO index. */
unsigned int n_entries; /**< Number of PDO entries in \a entries to map.
Zero means, that the default mapping shall be
used (this can only be done if the slave is
present at bus configuration time). */
ec_pdo_entry_info_t *entries; /**< Array of PDO entries to map. Can either
be \a NULL, or must contain at
least \a n_entries values. */
} ec_pdo_info_t;
/*****************************************************************************/
/**14 Sync manager configuration information.
*同步管理器配置信息
* This can be use to configure multiple sync managers including the PDO
* assignment and PDO mapping. It is used as an input parameter type in
* ecrt_slave_config_pdos().
这可以用来配置多个同步管理器,包括PDO分配和PDO mappinq。
它被用作输入参数类型ecrt_salve_config pdos()。
*/
typedef struct {
uint8_t index; /**< Sync manager index. Must be less同步管理器索引,必须小于
than #EC_MAX_SYNC_MANAGERS for a valid sync manager作为一个合法的同步管理器,
but can also be \a 0xff to mark the end of the list. 也可以用0xff作为结束的标志*/
ec_direction_t dir; /**< Sync manager direction. 同步管理器的方向*/
unsigned int n_pdos; /**< Number of PDOs in \a pdos. PDO的数量*/
ec_pdo_info_t *pdos; /**< Array with PDOs to assign. This must contain被分配的PDO的数组,必须包含N条PDOS
at least \a n_pdos PDOs. */
ec_watchdog_mode_t watchdog_mode; /**< Watchdog mode.看门狗模式 */
} ec_sync_info_t;
/*****************************************************************************/
/**15 List record type for PDO entry mass-registration.
*列出PDO输入批量注册的记录类型。
* This type is used for the array parameter of the
* ecrt_domain_reg_pdo_entry_list()
*/
typedef struct {
uint16_t alias; /**< Slave alias address. 从站假名地址*/
uint16_t position; /**< Slave position. 从站位置*/
uint32_t vendor_id; /**< Slave vendor ID. 从站供应商ID*/
uint32_t product_code; /**< Slave product code. 从站产品编码*/
uint16_t index; /**< PDO entry index.PDO条目索引 */
uint8_t subindex; /**< PDO entry subindex. PDO条目子索引*/
unsigned int *offset; /**< Pointer to a variable to store the PDO entry's用于存储PDO表项的变量指针
(byte-)offset in the process data. 在过程数据中的偏移*/
unsigned int *bit_position; /**< Pointer to a variable to store a bit
position (0-7) within the \a offset. Can be
NULL, in which case an error is raised if the
PDO entry does not byte-align. /**<指向一个变量的指针,
用于在\a偏移量中存储位(0-7)。可以为NULL,在这种情况下,
如果PDO条目没有按字节对齐,将引发错误。*/u*/
} ec_pdo_entry_reg_t;
/*****************************************************************************/
/**16 Request state.
*请求状态
* This is used as return type for ecrt_sdo_request_state() and
* ecrt_voe_handler_state().
*/
typedef enum {
EC_REQUEST_UNUSED, /**< Not requested. 没有请求*/
EC_REQUEST_BUSY, /**< Request is being processed. 请求正在处理*/
EC_REQUEST_SUCCESS, /**< Request was processed successfully. 请求处理成功*/
EC_REQUEST_ERROR, /**< Request processing failed. 请求处理失败*/
} ec_request_state_t;
/*****************************************************************************/
/**17 Application-layer state.应用层状态
*/
typedef enum {
EC_AL_STATE_INIT = 1, /**< Init. 初始化*/
EC_AL_STATE_PREOP = 2, /**< Pre-operational.预操作 */
EC_AL_STATE_SAFEOP = 4, /**< Safe-operational. 安全操作*/
EC_AL_STATE_OP = 8, /**< Operational. 操作*/
} ec_al_state_t;
相关推荐
EtherCAT IGH 驱动一个步进电机
EtherCAT IGH 驱动一个步进电机。
igh ethercat应用层代码分析
igh ethercat应用层代码分析 igh ethercat可以自己编写应用层代码与从站进行数据交互,本身主站给了例子,在example文件夹下,根据自己平台选择看某个例子,一般刚开始可以看user文件夹下的main.c文件,下面是我进行了一些修改,也带了一些解释。其实也就是控制io做流水灯操作。 #include <errno.h> #include <signal.h&g...
TI5728的igh ethercat master 移植
目前采用的是JN-5728mini开发版。 JN-mini5728_rt_3.3.zip拷贝到本地解压 准备工作: 0.开发环境搭建 参考《Ubuntu开发环境搭建 V1.1.pdf》,《JN-mini5728 软件使用手册 V2.0.pdf》 1.下载ethercat1.5.2 下载ethercat ,找到文件夹对应的ethercat-1.5.2这个版本是针对内核4.0+修改过源码的,如果下...
etherCAT学习笔记
为了在Linux中搭建etherCAT运行环境,首先对标准Linux内核进行扩展,增加Xenomai实时补丁,重新编译内核,构建实时Linux操作系统。然后在新系统中安装etherCAT工具,搭建主站环境。 1.安装参考教程 https://blog.csdn.net/Allforyouz/article/details/78713453?locationNum=10&fps=1&tdsou...
zynqmp + igh ethercat主站方案设计及程序
zynqmp纯PS端的主站方案,不涉及PL端,主站代码是IGH 1.5.2, 硬件平台 xilinx官方zc102开发板,4核A53架构 最便宜的开发板是 FPGA开发板 UltraScale+ ZU3EG ZYNQ MPSOC Edgeboard深度学习AI https://item.taobao.com/item.htm?spm=a230r.1.14.24.17b83da...
告别Windows和TwinCAT:用树莓派+开源IgH搭建低成本EtherCAT主站全流程
本文详细介绍了如何利用树莓派和开源IgH EtherCAT主站搭建低成本工业自动化解决方案,替代昂贵的Windows和TwinCAT商业方案。从硬件准备、系统配置到IgH主站的编译安装和网络调试,提供了全流程指导,特别适合个人开发者和小型团队实现高性价比的EtherCAT控制。
浅谈EtherCAT主站EOE(下)-EtherCAT IgH主站EoE具体实现
Ethernet over EtherCAT (EoE) 是一种通信协议,它允许通过网络连接访问从站设备的参数,以便配置和诊断从站设备。EoE 允许将常见的互联网协议(如 HTTP、FTP 等)的数据插入到 EtherCAT 协议数据中,而不影响 EtherCAT 过程数据 ,本文介绍了linux内核态EtherCAT主站igh 中EoE的具体实现,希望对你有所帮助。
保姆级教程:用IGH EtherCAT库控制雷赛伺服电机(PV模式,附完整C代码)
本文提供了一份详细的IGH EtherCAT库控制雷赛伺服电机的保姆级教程,涵盖PV模式下的环境配置、状态机调试及完整C代码实现。通过实战案例,帮助开发者快速掌握EtherCAT在工业自动化中的应用,提升运动控制系统的实时性和精度。
【原创】浅谈EtherCAT主站EOE(下)-EtherCAT IgH主站EoE具体实现
每个EOE虚拟网卡对应一个EoE handler,多个从站就需要多个handler,且Linux协议层下发的skb远大于邮箱大小,每个skb需要多次邮箱通信才能完成一个skb发送,若将所有handler放到idle_thead或operat_thead去处理,不仅严重影响其他数据交互的及时性,而且每几个周期只能发送或接收一个EoE片段,这导致数据速率非常低,因为在应用程序周期之间的时间内未执行EoE状态机,EoE数据速率将取决于应用程序任务的周期。填写 IP 层的头。从站发送的EOE数据包一个相反的过程。
Ubuntu 22.04下,用Twincat3+IGH搞定零差云控电机EtherCAT调试(附完整避坑清单)
本文详细介绍了在Ubuntu 22.04系统中,如何结合Twincat3和IGH实现零差云控电机的EtherCAT全流程调试。从环境准备、核心组件部署到网络拓扑构建与诊断,再到运动控制参数调优和高级调试技巧,提供了完整的避坑清单和实战指南,帮助开发者高效完成工业自动化项目。
EtherCAT主站IGH-- 27 -- IGH之globals.h文件解析
定义功能和用途:定义了数据报文超时的时间,单位为微秒。使用场景:在处理数据报文通信时,设置等待响应的超时时间。定义功能和用途:定义了 SDO 注入超时的时间,单位为微秒。使用场景:在处理 SDO(服务数据对象)通信时,设置等待响应的超时时间。定义功能和用途:定义了发送一个字节所需的时间,单位为纳秒。使用场景:用于计算数据传输时间。定义功能和用途:定义了在数据报文超时后的重试次数。使用场景:在状态机中处理数据报文通信时设置重试次数。定义功能和用途。
Intel-ECI之 Linux Intel LTS PREEMPT_RT内核+IgH Ethercat
2、登录后,您应该会看到 Edge Controls for Industrial (适用于工业的边缘控制) 页面,其中包含获取 ECI 的选项。建议 ECI 的新用户使用此选项,这将设置公共 ECI 存储库,从中可以很容易地将 ECI 软件包安装到目标系统上。EtherCAT 协议栈的源代码可以在以下位置找到:/var/lib/dkms/ighethercat-dkms//1.6/source。为了使用所有 ECI 功能,目标系统应满足建议的系统要求,以便您可以安装 ECI Deb 软件包。
【NXP i.MX91】 移植运行IGH EtherCAT主站
EtherCAT主站、从站通信测试
EtherCAT对象字典分析
EtherCAT开发中,主要通过两款软件查看XML文件,分别是"XML Notepad"和"Altova XMLSpy",两款界面如下: 通过对比可以看出Altova XMLSpy软件显示的更为直观,因此我在开发时主要使用此软件。 接下来进入正题。通过igh开发EtherCAT应用程序首先必须知道从站的对象字典,我们可以通过igh自带的ethercat软件查看从站的对象字典。实验设备为安装了xe...
innovus中path group 的策略和应用(上)
在所有的后端工具里边,有三个重要的引擎:auto-place,CTS,auto-route三个。这里边的auto-place是决断了整个设计时序的基点。。当然,就算是到了CTS/route阶段后,也可以继续利用auto-place数据优化的功能,在数据库上做数据路径增量优化(optDesign -increment)。可以说,数据路径的优化手段,实际上是贯穿在整个后端流程上的。。看看这其中的奥妙和有趣的事情。ICer GO!
SAR ADC和sigma delta ADC的区别
0、ADC基本概念 ADC,即analog to digital converter,模拟到数字的转换器,简称模数转换器。 为什么需要ADC?因为现实的世界中,电信号是连续的,例如心电信号,或者声音信号,这些连续的信号被称为“模拟信号”。 图1:心电信号 图2:声音信号 然而这种连续的信号是无法被计算机处理的,计算机只认识0和1组成的“数字信号“。ADC就充当了这样一个桥梁,将“模拟信号”转换为计算机能识别的“数字信号”。举个例子,当前的心电电压为1.2V(实际没有这么高),ADC可能会得
ubuntu14.04、xenomai3.1、ethercat igh构建主站(3)
这篇主要写了一个小例子的运行。我把完整的工程项目上传到了CSDN上。 分享两个ethercat igh master 采用倍福的EL2008,运行效果如下图所示。 Makefile 之前有人问我怎么编译?我写了一个Makefile,在工程目录输入make就可以了。代码如下: CC = x86_64-linux-gnu-gcc INCPATH = -I./igh-output/include -I./xenomai-Output/include -I./xenomai-Output/inc
抓包工具(五)2025版 Burp Suite Professional的下载、安装、使用
抓包工具(五)2025版 Burp Suite Professional的下载、安装、使用
Intel-ECI之Linux Intel LTS Xenomai Dovetail内核+IgH Ethercat
基于intel ECI 软件库安装xenomai 实时内核,安装IgH ethercat 协议主站
从零开始:用ZEMAX设计双高斯照相物镜的完整流程(附55mm焦距实例)
本文详细介绍了使用ZEMAX设计双高斯照相物镜的完整流程,特别针对55mm焦距实例进行了深入解析。从初始结构选择、参数设置到优化策略和像质分析,逐步指导读者掌握这一经典光学设计方法。通过具体实例展示了如何实现卓越的像差校正,适用于35mm相机标准镜头等应用场景。
【肌电处理】肌电信号EMG积分肌电值+均方根值+中值频率+平均功率频率【含Matlab源码 3386期】
肌电信号EMG积分肌电值+均方根值+中值频率+平均功率频率 完整的代码,方可运行;可提供运行操作视频!适合小白!
7293



被折叠的 条评论
为什么被折叠?



