下载SOEM源码
$ git clone https://github.com/OpenEtherCATsociety/SOEM.git
编译源码
进入SOEM源码目录
$ mkdir build && cd build
$ cmake ..
$ make
测试
eth1 位网卡名
$ cd test/linux/slaveinfo/
$ sudo ./slaveinfo eth1SOEM (Simple Open EtherCAT Master)
Slaveinfo
Starting slaveinfo
ec_init on eth1 succeeded.
ec_config_init 0
DEBUG 1- wkc:1
DEBUG wkc:1
ec_config_map_group IOmap:0x55883f0208 group:0>Slave 1, configadr 1001, state 02CoE Osize:0 Isize:0SII Isize:0SII Osize:0ISIZE:0 0 OSIZE:0SM programmingSM2 Type:3 StartAddr:1800 Flags:00000064SM3 Type:4 StartAddr:1c00 Flags:00000020
IOmapSize 0
Time: 14468.473 SDO slave:1 index:1c00.00 error:06020000 The object does not exist in the object directory
Time: 14468.475 SDO slave:1 index:1c00.00 error:06020000 The object does not exist in the object directory
1 slaves found and configured.
Calculated workcounter 0
Not all slaves reached safe operational state.
Slave 1 State=12 StatusCode= 1e : Invalid input configurationSlave:1Name:EA7000-V2Output size: 0bitsInput size: 0bitsState: 18Delay: 0[ns]Has DC: 1DCParentport:0Activeports:1.0.0.0Configured address: 1001Man: 0000177a ID: 00000001 Rev: 00010001SM0 A:1000 L: 529 F:00010026 Type:1SM1 A:1400 L: 529 F:00010022 Type:2SM2 A:1800 L: 0 F:00000064 Type:3SM3 A:1c00 L: 0 F:00000020 Type:4FMMUfunc 0:1 1:2 2:3 3:0MBX length wr: 529 rd: 529 MBX protocols : 04CoE details: 23 FoE details: 00 EoE details: 00 SoE details: 00Ebus current: 0[mA]only LRD/LWR:0
End slaveinfo, close socket
End program