完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好
我尝试实现 modbus RTU 主站,但有一个问题,即当有许多数据要写入从站时,从站收到一个分成多个数据包的数据包。例如,如果一个写入多个保持寄存器包(FC:03, Addr:0, Num:100) 被发送到slave 那么下面的数据将被接收到slave 并且slave 在正常情况下发送响应。 [size=\"2\"][color=\"#000000\"]接收:002192-01 10 00 00 00 64 C8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0 0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0 0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0 0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0 0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 D4 93 [size=\"2\"] Tx:002193-01 10 00 00 00 64 C1 E2 但是,slave 有时会收到如下从一个数据包中分割出来的多个数据包。因为slave收到了异常的包,所以没有给master发送响应。 [size=\"2\"]接收: 002256-01 10 00 00 00 [size=\"2\"]接收: 002257-64 C8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0 0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Rx:002258-00 00 00 00 00 00 00 00 [size=\"2\"]00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0 0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 D4 93 奇怪的是,这个问题在所有波特率的 UART1 中都没有发生。与 UART1 不同,UART 3 有这个问题,但在 115200bps 波特率设置下没有这个问题。鉴于此症状,我认为时钟设置不正确。请给我一些关于这个问题的建议。 为了只看到这个问题,我使用了SDK中的ipuart_interrupt_rb_transfer示例工程,修改为发送一个写入多个寄存器的数据包。 |
|
相关推荐
|
|
只有小组成员才能发言,加入小组>>
1907个成员聚集在这个小组
加入小组我的项目我做主,使用GN+Ninja来完成构建系统(VSCode开发RT106X)
36358 浏览 0 评论
NXP IMX8应用处理器快速入门必备:技巧、使用、设计指南
4396 浏览 0 评论
6050 浏览 1 评论
6763 浏览 0 评论
NXP i.MX6UL开发板(linux系统烧录+规格+硬件+模块移植)使用手册
4213 浏览 0 评论
619浏览 2评论
求助,S32G上Core M启动后如何让Core A在Flash指定位置加载uboot?
615浏览 2评论
ESP32-WROVER-IE + LAN8720以太网,GPIO0电压只有1.6v,无法正常进入spi flash boot模式如何解决?
606浏览 2评论
求分享适用于PN7160 Android的NFC工厂测试应用程序
694浏览 2评论
798浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-23 16:23 , Processed in 1.143234 second(s), Total 79, Slave 62 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号