问题描述
我正在使用 c# 和 Serialport 和 com0com(虚拟串行端口)我的问题是我的 c# 应用程序无法从超级终端接收数据,事件 DataRecived 没有被触发,如果我手动调用 readExisting 我什么也得不到要测试这个问题,你可以创建一个像这个有同样问题的基本 c# 应用程序 http://balau82.wordpress.com/2009/04/18/simplest-serial-port-terminal-in-csharp/ ,如果你运行这个应用程序的 2 个实例没问题,但是如果您运行一个实例和超级终端,则数据将从 C# 发送到 hiperterminal,而不是从超级终端返回.
i am using c# and Serialport and com0com(virtual serial ports) My problem is that my c# application can't recive data from hyperterminal,the event DataRecived is not fired and if i call manualy the readExisting i get nothing To test this problem you can create a basic c# app like this one that has same problem http://balau82.wordpress.com/2009/04/18/simplest-serial-port-terminal-in-csharp/ , if you run 2 instances of this app all is ok, but if you run one instance andne hyperterminal the data is send from C# to hiperterminal but not from hyperterm back.
推荐答案
太简单了,保证不行.您需要在 SerialPort 上设置通信属性以将它们与超级终端匹配.至少波特率、数据位、奇偶校验和停止位.如果没有检测到在线设备,超级终端将不会发送任何内容.您必须将 RtsEnable 和 DtrEnable 属性设置为 true.
It's rather too simple, guaranteed to not work. You'll need to set the communication properties on the SerialPort to match them with HyperTerminal. Baudrate, DataBits, Parity and StopBits at least. And HyperTerminal won't send anything if it doesn't detect the device on-line. You have to set the RtsEnable and DtrEnable properties to true.
这篇关于C# 串口和超级终端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)