COM端口访问问题(串行端口仿真) [英] Issue with COM Port Access (serial port emulation)

查看:252
本文介绍了COM端口访问问题(串行端口仿真)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个用于手持式条形码阅读器的界面,但是在使用Visual Studio 2005访问COM端口时遇到了麻烦.

I'm developing an interface for a handheld barcode reader, and I'm having trouble with accessing the COM port with Visual Studio 2005.

该设备具有USB连接,但随附用于模拟串行端口的驱动程序.每当我尝试使用System.IO.Ports访问设备时,都会收到错误消息:``给定的端口名不是以COM/com开头或不能解析为有效的串行端口.参数名称:portName"

The device has a USB connection, but comes with drivers to emulate a serial port.  Whenever I try to access the device with System.IO.Ports, I get the error:  "The given port name does not start with COM/com or does not resolve to a valid serial port.  Parameter name:  portName"

Visual Studio访问端口的级别是否低于USB仿真的级别?

Is Visual Studio accessing the port at a lower level than the USB is emulating?

思想,评论.

推荐答案

要为portName参数传递给Open的值是什么?

What is the value you are passing into Open for the portName parameter?

portName不仅在寻找端口的名称,而且还在寻找端口的名称,因此,如果要访问端口5,则需要呼叫COM5.

portName is looking for name of the port, not just number, so if you want to access port 5 you’d call for COM5.


这篇关于COM端口访问问题(串行端口仿真)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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