如何使用c#从系统串口读取数据 [英] How to read data from serial port of system using c#

查看:265
本文介绍了如何使用c#从系统串口读取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为称重桥创建软件,同时尝试阅读数据使用c#代码,它显示一些其他数据 

推荐答案

从C#中,使用SerialPort类从串口读取。

From C#, use the SerialPort class to read from the serial port.

如果数据以垃圾形式进入,请检查SerialPort的配置(每秒位数,每字位数,停止位,奇偶校验)。如果设置与正在传输数据的设备不匹配,则无法获得正确的字符。

If the data comes in as garbage, check the configuration of the SerialPort (bits per second, bits per word, stop bits, parity). If the settings don't match those of the device that is transmitting the data, you will not get the correct characters.


这篇关于如何使用c#从系统串口读取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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