监控串口已打开
我尝试通过已打开的串行端口读取数据。
我已经使用 C# 和 C++ 库来使用 microsoft api(重叠和非重叠 I/O),但不起作用。
我可以使用相同的 Windows api 吗?还是其他??
预先感谢您的空闲,
克里斯蒂亚诺
I am try to read data over serial port already open.
I have used C# and c++ library for use microsoft api (overlapped and not overlapped I/O), but not work.
I can use same windows api? or other??
Thanks in advance for your availability,
Cristiano
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Eltima 为此目的制作了一个软件。我用它作为调试工具。除了允许您访问已建立的链接上的流量之外,它还提供了许多用于记录和分析的功能。
http://www.virtualserialport.com/products/serialmonitor/
Eltima makes a software for this very purpose. I use it as a debugging tool. In addition to giving you access to the traffic on an established link it provides a number of features for logging and analysis.
http://www.virtualserialport.com/products/serialmonitor/
我假设当您想要向后设计串行端口设备的协议时。
如上所述,如果线路已经打开,这可能会很棘手,但可以通过几个额外的串行端口来完成。
为此,您需要在计算机(或单独的 PC)上安装 2 个额外的串行端口,并使用一根小电缆将两个端口连接在一起。
因此,您已设置
COM 1 - 通过小电缆(rx 到 tx 等)连接到 COM 2。
COM 3——连接串口设备。
驱动串行端口设备的软件将配置为 COM 1。
电缆将所有流量从 COM 1 物理路由到 COM 2,然后您的软件将路由 COM 2 和 COM 3 之间的所有串行流量并记录其间的数据。
如果您想对设备的串行协议进行反向工程,这是一种有用的技术。
I'm taking the assumption that when you want to backwards engineer the protocol of a serial port device.
As posted above, it can be tricky if the line is already open, but can be done with a couple of extra serial ports.
In order to do this you need to 2 extra serial ports installed on your machine (or a seperate PC) and a small cable to link two of the ports together.
So you have this set up
COM 1 - connected to COM 2 via a small cable (rx to tx, etc).
COM 3 - connected to the serial port device.
The software that drives the serial port device would be configured to COM 1.
A cable physically routes all traffic from COM 1 to COM 2, your software would then route all serial traffic between COM 2 and COM 3 and logging the data inbetween.
This is a useful technique if you want to backwards engineer a serial protocol for a device.