读取串行端口中的数据时丢失数据 [英] missing data in recieving data from serial port when read it

查看:384
本文介绍了读取串行端口中的数据时丢失数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从串口接收数据时遇到问题,我错过了
读取缓冲区时的其他数据
我该如何解决这个问题,请帮帮我
我的电子邮件[DELETED] @ yahoo.com

[edit]除非您真的喜欢垃圾邮件,否则请不要在任何论坛中发布您的电子邮件地址!如果有人回复您,您将收到一封电子邮件,通知您
-OriginalGriff [/edit]

I have a problem when I recive data from serial port I miss
other data when I read buffer
how can I solve this problem please help me
my email [DELETED]@yahoo.com

[edit]Never post your email address in any forum, unless you really like spam! If anyone replies to you, you will receive an email to let you know
- OriginalGriff[/edit]

推荐答案

OriginalGriff和Henry Minute是正确的:您应该提供有关问题的更多详细信息.

我会给你忠告的.如果在发送命令并要求硬件确认时遇到问题,请记住在接收数据之前应该稍等一下.
OriginalGriff and Henry Minute are right: you should give more details about your problem.

Hovewer I will give you pieve of advice. If you are having the problem while sending a command and asking for an acknowledgment from the hardware, then keep in mind that your should wait a little bit before receiving the data.
SendData();
//wait a little bit before reading the answer
System.Threading.Thread.Sleep(500);
ReadData();



但是再次,如果您提供更多信息,我们可能会更好地帮助您...



But once again, if you provide more information we will probably help you better...


这篇关于读取串行端口中的数据时丢失数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆