基于IgH主站接了3个从站,分析报文。
涉及的从站寄存器:Configured Station Address 0x0010:0x0011。
使用场景举例:
IgH启动后,通过“配置从站地址”报文将所有从站地址清零,然后通过APWR指令+“配置从站地址”报文,设置各个从站的地址。
一、发送报文
1,IgH dmesg看到的报文
[ 2501.084403] EtherCAT DEBUG 0: frame size: 46 [ 2501.084404] EtherCAT DEBUG 0: Sending frame: [ 2501.084404] EtherCAT DEBUG: FF FF FF FF FF FF 6C 24 08 29 52 19 88 A4 0E 10 [ 2501.084409] EtherCAT DEBUG: 08 01 00 00 10 00 02 00 00 00 00 00 00 00 00 00 [ 2501.084413] EtherCAT DEBUG: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 2501.084418] EtherCAT DEBUG: 00 00 00 00 00 00 00 00 00 00 00 00 |
2,报文解析
3,wireshark报文
二、响应报文
1,IgH dmesg看到的报文
[ 2501.192240] EtherCAT DEBUG 0: Received frame: [ 2501.192241] EtherCAT DEBUG: FF FF FF FF FF FF 6E 24 08 29 52 19 88 A4 0E 10 [ 2501.192246] EtherCAT DEBUG: 08 01 03 00 10 00 02 00 00 00 00 00 03 00 00 00 [ 2501.192252] EtherCAT DEBUG: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 2501.192256] EtherCAT DEBUG: 00 00 00 00 00 00 00 00 00 00 00 0 |
2,报文解析
IgH主站广播了设置从站地址的命令,3个从站收到报文后,将本机地址改成了0x0000,以后FPRD/FPWR/FPRW/FRMW需要通过0x0000地址才能访问到该从站。