谁来做串口连接? [英] who to make the serial port Connection?

查看:53
本文介绍了谁来做串口连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使端口连接错误,提示串行端口CoM/com不存在的串行端口连接.

I am trying the Serial port connection that givin me error that serial port CoM/com is not there

推荐答案

您是否正在使用SerialPort类进行连接.该错误可能是由于无效的端口名引起的.下面的代码在这里可以正常工作.尝试此操作,
要创建连接,

SerialPort port = new SerialPort("COM1");

要打开端口

Are you using the SerialPort class for the connection.The error may be due to the invalid port name.The following code works fine here.Try this,
To Create the connection,

SerialPort port = new SerialPort("COM1");

To Opens the port

if (false == port.IsOpen)<br />
      {<br />
        port.Open();<br />
      }



写入数据
port.Write("test");

问候,
Vineeth



To Write the data
port.Write("test");

Regards,
Vineeth


您确定您的计算机上有一个名为com1的com吗?请在设备管理器中检查它.
are you sure your computer has a com that named com1?? please check it in device manager.


您需要在此处发布一些代码-您提供的信息肯定不够.
You need to post some code here - the information provided by you is certainly not enough.


这篇关于谁来做串口连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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