听串行COM端口正在使用

听串行COM端口正在使用

问题描述:

我处理与使用RS232与外围设备进行通信的一些遗留系统。我不是很有经验的COM接口。我有一些code,可以打开并使用COM端口,但不能打开使用其他应用程序的端口。我需要黑箱数据包,这样我们就可以使用相同的协议进行更新的通信。

I'm dealing with some legacy systems that are using RS232 to communicate with peripherals. I'm not very experienced with COM interfacing. I have some code that can open and use COM ports, but it can't open ports that are used by other applications. I need to black box the packets so that we can use the same protocol for updated communications.

有什么办法来中间人的传入数据包,以一个开放的COM端口,并检测哪些数据包被发送?我使用.NET,但我接受任何类型的解决方案。

Is there any way to "middle man" incoming packets to an open COM port and detect what packets are being sent? I'm using .NET, but I'm open to any type of solution.

(我发现的在那里,但我不认为这会为我工作。)

(I found this out there, but I don't think this will work for me.)

我用com0com - 这是伟大的设置虚拟COM端口 - 这并不能帮助你在任何

I've used com0com - it's great for setting up virtual com ports - which doesn't help you at all.

COM端口接口基本上是'读取文件。当我尝试连接到已有的另一个实例从中读取一个COM口我的应用程序将引发异常。我不知道,如果你可以尝试打开它作为一个只读,而不是读写的,但它是值得一试的。

The COM port interface is basically a 'file read'. My application throws an exception when I try to connect to a COM port that already has another instance reading from it. I'm not sure if you could try opening it as a 'read only' instead of read-write, but it's worth a try.

您应该能够编写一个虚拟COM端口可以将数据派生关到一个日志文件。 Com0com是开源的,所以你可以使用它作为一个起点。

You should be able to write a virtual com port that can fork off your data to a log file. Com0com is open-source, so you could use that as a starting point.

另一种可能的解决办法是拿起一个rs232分路器电缆叉串行信号到另一个串行端口。

Another possible solution could be to pick up an rs232 splitter cable forks the serial signal to another serial port.

或者另一种可能性是串行嗅探程序(或open源嗅探器)。

Or yet another possibility is a Serial Sniffer program (or an open source sniffer).

或尝试hub4com应用来自同一com0com网站!

Or try the hub4com app from the same com0com website!