简体   繁体   English

读取C#中的串行端口引脚

[英]Reading Serial Port pins in C#

I have a device connected to my computer via RS232 to USB. 我有一台设备通过RS232到USB连接到我的计算机。 This device hold times for eight tanning beds. 该设备可容纳八张晒黑床的时间。 I want to get the data from the pins on the serial port to see how it is connecting with the device, to see how the times are being displayed. 我想从串行端口的引脚上获取数据,以查看其与设备的连接方式,以及如何显示时间。 I am hoping to do this is C#, but I'm not sure exactly where I need to start. 我希望使用C#来实现,但是我不确定该从哪里开始。 I have thought about probing the pins on an oscilloscope, but that seems very tedious. 我曾考虑过探查示波器上的引脚,但这似乎非常乏味。 Any thoughts? 有什么想法吗?

I just ran in to this my self. 我只是碰到了我自己。 If you are not using a 64 bit version of windows I would recommend using PortMon , save the log file, then do offline parsing of your log file. 如果您使用的不是64位版本的Windows,建议您使用PortMon ,保存日志文件,然后对日志文件进行脱机解析。 There are libraries that let you hook in to the stream via code but I think using PortMon you may not even need to write any code at all and you may be able to just figure out the protocol by visual inspection. 有一些库可以让您通过代码连接到流,但是我认为使用PortMon甚至根本不需要编写任何代码,并且您可以通过直观检查找出协议。

If you are using a 64 bit version of windows your choices are severely limited. 如果您使用的Windows是64位版本,则您的选择将受到严格限制。 I could not find a free program that was compatible with windows 7 x64, The only program I heard that works (but I did not buy it and the free version did not work) is Serial Port Monitor by HHD. 我找不到与Windows 7 x64兼容的免费程序, 听说的唯一有效的程序(但我没有购买,并且免费版本不起作用)是HHD的串行端口监视器

You can also try running the software in XP Mode to get the 32 bit monitoring programs running, it worked for me. 您也可以尝试在XP模式下运行该软件,以使32位监控程序运行,它对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM