参考博客 https://blog.csdn.net/MuscleBaBa_Chang/article/details/82957002?utm_medium=distribute.pc_aggpage_search_result.none-task-blog-2~all~first_rank_v2~rank_v25-4-82957002.nonecase&utm_term=modbusscan%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E&spm=1000.2123.3001.4430 此为主站 打开从站modbus slave 设置与主站相同的功能码 用wireshark捕获流量数据 主站的Length长度和从站的额寄存器或线圈数量相同