EtherCAT主站SOEM -- 51 -- SOEM2.0之ec_main.h/c主站上下文与运行主线解析
EtherCAT主站SOEM -- 51 -- SOEM2.0之ec_main.h/c主站上下文与运行主线解析
- 0 Win QT & VS和Ubuntu QT & STM32F767 移植SOEM
- 0.0 移植环境预览:
- 0.1 Ubuntu18.04系统QT-SOEM博客、视频欣赏及源代码链接
- 0.2 STM32F767-SOEM 博客、视频欣赏及源代码链接
- 0.3 Win11/10系统QT-SOEM博客、视频欣赏及源代码链接
- 0.4 Win11/10系统VisualStudio -SOEM 博客、视频欣赏及源代码链接
- 0.5
- 一 ec_main.c/h 文件功能预览
- 二 主站对象和数据流
- 2.1 `ecx_contextt` 是所有 `ecx_*` API 的根对象
- 2.2 `ec_slavet`:从站运行时档案
- 2.3 `ec_groupt`:过程数据和邮箱的分组边界
- 2.4 邮箱池、队列与索引栈
- 三 ec_main.h 公共类型和 API
- 3.1 类型、宏和字段速查
- 3.2 错误、适配器、初始化和资源 API
- 3.3 SII/EEPROM 缓存 API
- 3.4 状态和过程数据 API
- 3.5 邮箱池、队列和邮箱处理 API
- 3.6 每个公开 API 详细说明
- 3.6.1 `ec_find_adapters()`
- 3.6.2 `ec_free_adapters()`
- 3.6.3 `ec_nextmbxcnt()`
- 3.6.4 `ec_clearmbx()`
- 3.6.5 `ecx_pusherror()`
- 3.6.6 `ecx_poperror()`
- 3.6.7 `ecx_iserror()`
- 3.6.8 `ecx_packeterror()`
- 3.6.9 `ecx_init()`
- 3.6.10 `ecx_init_redundant()`
- 3.6.11 `ecx_close()`
- 3.6.12 `ecx_siigetbyte()`
- 3.6.13 `ecx_siifind()`
- 3.6.14 `ecx_siistring()`
- 3.6.15 `ecx_siiFMMU()`
- 3.6.16 `ecx_siiSM()`
- 3.6.17 `ecx_siiSMnext()`
- 3.6.18 `ecx_siiPDO()`
- 3.6.19 `ecx_readstate()`
- 3.6.20 `ecx_writestate()`
- 3.6.21 `ecx_statecheck()`
- 3.6.22 `ecx_mbxhandler()`
- 3.6.23 `ecx_mbxempty()`
- 3.6.24 `ecx_mbxsend()`
- 3.6.25 `ecx_mbxreceive()`
- 3.6.26 `ecx_mbxENIinitcmds()`
- 3.6.27 `ecx_esidump()`
- 3.6.28 `ecx_readeeprom()`
- 3.6.29 `ecx_writeeeprom()`
- 3.6.30 `ecx_eeprom2master()`
- 3.6.31 `ecx_eeprom2pdi()`
- 3.6.32 `ecx_readeepromAP()`
- 3.6.33 `ecx_writeeepromAP()`
- 3.6.34 `ecx_readeepromFP()`
- 3.6.35 `ecx_writeeepromFP()`
- 3.6.36 `ecx_readeeprom1()`
- 3.6.37 `ecx_readeeprom2()`
- 3.6.38 `ecx_receive_processdata_group()`
- 3.6.39 `ecx_send_processdata()`
- 3.6.40 `ecx_receive_processdata()`
- 3.6.41 `ecx_send_processdata_group()`
- 3.6.42 `ecx_getmbx()`
- 3.6.43 `ecx_dropmbx()`
- 3.6.44 `ecx_initmbxpool()`
- 3.6.45 `ecx_initmbxqueue()`
- 3.6.46 `ecx_slavembxcyclic()`
- 四 ec_main.c 原文件实现解析
- 4.1 初始化、关闭与错误路径
- 4.2 EEPROM 缓存与 SII 读取
- 4.3 状态读取和状态转换
- 4.4 邮箱池和周期邮箱处理
- 4.5 过程数据发送:非阻塞组帧和分段
- 4.6 过程数据接收:匹配、复制和 WKC
- 4.7 源文件中的内部辅助函数
- 五 使用建议和常见问题
- 5.1 `ecx_contextt` 的初始化和所有权
- 5.2 过程数据周期调用顺序
- 5.3 状态、WKC和邮箱错误的区分
- 六 硬件验证方法
- 七 ec_main.h/c 原文件的中文注释
- 7.1 ec_main.c
- 7.2 ec_main.h
- 八 总结
- 该文档修改记录:
- 上下博客链接
0 Win QT & VS和Ubuntu QT & STM32F767 移植SOEM
0.0 移植环境预览:
| 序号 | 硬件环境 | 开发软件 |
|---|---|---|
| 1 | Ubuntu18.04系统 | QT 5.13.2 及以上 |
| 2 | Win11/10系统 及 正点原子开发板阿波罗 STM32F767IGT6 | keil5 |
| 3 | Win11/10系统 | QT5.12.9及以上 |
| 4 | Win11/10系统 | VisualStudio 2017,建议使用2017版本 |
| 5 | 最近忙,忙完这段时间移植 |
