主站

2025/2/1 16:38:10

SOEM源码解析——ecx_detect_slaves(初始化从站、检测从站数量)

0 工具准备 1.SOEM-master-1.4.0源码1 ecx_detect_slaves函数总览 /*** @brief 检测从站数量* * @param context 句柄* @return int 从站数量*/ int ecx_detect_slaves(ecx_contextt *context) {uint8 b;uint16 w;int wkc;/* make special pre-init register writes to e…

EtherCAT主站IGH-- 25 -- IGH之fsm_slave_scan.h/c文件解析

EtherCAT主站IGH-- 25 -- IGH之fsm_slave_scan.h/c文件解析 0 预览一 该文件功能`fsm_slave_scan.c` 文件功能函数预览二 函数功能介绍`fsm_slave_scan.c` 中主要函数的作用1. `ec_fsm_slave_scan_state_start`2. `ec_fsm_slave_scan_state_address`3. `ec_fsm_slave_scan_stat…

SOEM源码解析——eeprom_read(读EEPROM)

0 工具准备 1.SOEM-master-1.4.0源码1 eeprom_read函数总览 eeprom_read函数在SOEM源码的路径如下:test->linux->eepromtool->eepromtool.c,功能是读取指定字地址和长度的EEPROM数据: /*** brief 读取EEPROM数据* * param slave …

EtherCAT主站IGH-- 23 -- IGH之fsm_slave.h/c文件解析

EtherCAT主站IGH-- 23 -- IGH之fsm_slave.h/c文件解析 0 预览一 该文件功能`fsm_slave.c` 文件功能函数预览二 函数功能介绍`fsm_slave.c` 中主要函数的作用1. `ec_fsm_slave_init`2. `ec_fsm_slave_clear`3. `ec_fsm_slave_exec`4. `ec_fsm_slave_set_ready`5. `ec_fsm_slave_…

SOEM源码解析——ecx_init_context(初始化句柄)

0 工具准备 1.SOEM-master-1.4.0源码1 ecx_init_context函数总览 /*** brief 初始化句柄* param context 句柄*/ void ecx_init_context(ecx_contextt *context) {int lp;*(context->slavecount) 0;/* clean ec_slave array *//* 清空从站信息数组 */memset(context->…

SOEM源码解析——ec_init(初始化单网卡主站)

0 工具准备 1.SOEM-master-1.4.0源码1 ec_init总览 /** Initialise lib in single NIC mode:初始化库在单网卡模式* param[in] ifname Dev name, f.e. "eth0" 设备名* return >0 if OK* see ecx_init*/ int ec_init(const char * ifname) {return ecx_init(&…