用表格接收C#中的数据 [英] reciving data in C# with forms

查看:66
本文介绍了用表格接收C#中的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在使用C#进行串行端口RS232的数据接收时遇到问题.
我发送设备的属性是数据位8,BundRate 57600,握手无,
读取缓冲区大小10,写入缓冲区大小5,停止位1.
我想使用表格和串行端口通过Visual Studio进行数据接收.
请帮助我.我试图得到错误信息,提示读取时间必须为整数",但读取时间以毫秒为单位.

Hi
I am having problem with data receiving for serial port RS232 with C# .
property of my sending divice is Data bits 8 ,BundRate 57600 ,handshake none ,
Read Buffer size 10 , write Buffer size 5,stop bit 1.
I wanna do data recieving with visual studio by using forms and serial port.
please help me .I tried I have got the Error said "Read time must be integer" but my read time is in millisecound .

推荐答案

如果您是指 SerialPort.ReadTimeout属性 [
If you mean the SerialPort.ReadTimeout Property[^] then milliseconds are entered as an integer, not a float or double. It is entered as a number of milliseconds, not as a fraction of a second. I.e. one seconds is set as 1000, not as 1.0, and a tenth of a second is entered as 100 not as 0.1


这篇关于用表格接收C#中的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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