使用RS-485自动检测到HW的COM端口连接 [英] Autodetect com-port connection to HW with RS-485

查看:144
本文介绍了使用RS-485自动检测到HW的COM端口连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我想通过USB线连接PC和硬件。其他硬件具有USB-> RS485转换器。



我现在的问题:

如何自动检测(COM-Port)连接并显示消息已成功连接。 ..用 C#



谢谢你,最好的问候

Thomas

Hello,

i want to connect a PC with a hardware via USB-cable. The other hardware has an USB->RS485 converter.

My question now:
How can i detect the (COM-Port)-connection automatically and show then a message "Connected successfully ..." with C#?

Thank you and best regards
Thomas

推荐答案

响应Wes给你看起来很轻浮,但这是现实的:即使链接是通过USB转换器连接,也无法在RS485链路上自动检测硬件。只是没有一个标准的即插即用RS485(几乎肯定永远不会)。其中一个原因是RS485旨在作为RS232的更长范围版本,也可作为多点布线解决方案而非点对点解决方案。所以设备无法播放我在这里!以标准的方式,因为它不知道连接上可能发生了什么。



我担心这样做的唯一方法就是连接并依次查询每个端口。
The response Wes gave you may seem flippant, but it is realistic: there is no way to autodetect hardware on a RS485 link even if the link is connected via a USB converter. There just isn't a standard for plug-and-play over RS485 (and almost certainly never will be). One of the reasons for this is that RS485 is intended as a longer range version of RS232, and also as a multidrop cabling solution rather than point-to-point. So a device can't broadcast "I am here!" in a standard way because it doesn't know what else might be going on on the connection.

I'm afraid that the only way to do this is to connect and query each port in turn.


这篇关于使用RS-485自动检测到HW的COM端口连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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