一个模拟串行设备以测试我的代码的程序? [英] A program that simulates a serial device to test my code?

查看:80
本文介绍了一个模拟串行设备以测试我的代码的程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我正在寻找一个可以模拟串行设备的程序,因此,当我运行通过COM端口发送数据的代码时,我可以看到正在从COM中发送的内容端口,而没有实际设备连接到我的计算机.
我一直在寻找这样的程序.现在我的问题是,您怎么称呼这样的程序?串口仿真器?还是虚拟串行端口仿真器?

我还记得曾经看到其他人使用Hyperterminal做这样的事情(我可能是错的),但是Win7中不再支持Hypertrm.任何建议表示赞赏.
------------
好的.我本来是想问一些可用的和合法的..我不自信只抓住一个首先出现在Google搜索上的程序.

Hi guys,i''m looking for a program that can simulate a serial device, so that when i run my code, which sends data thru the COM port, I can see what''s being sent out of the COM port without an actual device connected to my computer.
I''ve been searching for such programs.Now my question is what would you call such a program?? a Serial port emulator? or Virtual serial port emulator?

I kinda remember seeing someone else used Hyperterminal to do things like this(i may be wrong), but Hypertrm is not supported in Win7 any more. Any suggestions appreciated.
------------
Ok. I meant to ask for usable and LEGIT ones..I don''t feel confident just grabbing a program that comes out first on google search

推荐答案

我不知道"实际上没有使用任何这些串行端口嗅探器,因此恐怕我不推荐使用这些嗅探器.如果您对这种方法束手无策,请忽略此帖子.

我更喜欢对数据进行端到端验证,通常使用一根无效的调制解调器电缆连接两个串行端口,将其中一个发送出去,然后读取通过另一个端口传入的内容.

我对超级终端发表了评论,但这实际上不是我建议您使用的.相反,我认为您应该为此目的考虑编写自己的小程序,尤其是如果您要通过串行端口与许多不同的设备进行接口连接时.

我为公司开发了这样的工具.它将从串行端口读取传入的数据,将其显示在屏幕上,用时间戳标记数据块并将其存储到文件中.这样就可以记录数据并在以后的时间回放",从而模仿原始数据流.
如果您自己开发这样的工具,则显然不必向其添加播放功能.您可以仅在其中添加所需的功能(老板会允许您花时间在上面).就我而言,花在工具上的时间是值得的,而且我记得,它有助于清除串行端口库中的一些错误.

如果您只需要一次验证通信,则可以使用许多示例程序和代码来显示来自串行端口的传入数据-CP上有几个不错的程序.

Soren Madsen
I don''t actually use any of these serial port sniffers, so I am afraid I cannot recommend one. If you are dead set on this approach, please just ignore this post.

I prefer doing end-to-end verification of the data and normally connect two serial ports with a null modem cable, send stuff out one of the ports and read what comes in through the other port.

I made a comment about HyperTerminal, but that is actually not what I would recommend you use. Instead I think you should consider writing your own little program for this purpose, especially if you are going to be interfacing to many different devices through serial ports.

I developed a tool like this for my company. It will read incoming data from a serial port, display it on screen, tag the data blocks with a time stamp and store them to file. This makes it possible to record data and "play it back" at a later time, mimicking the original data flow.
If you develop a tool like this yourself, you obviously do not have to add playback functionality to it. You can put just the amount of functionality in it that you need (and your boss will let you spend time on). In my case, the time I spent working on the tool was well worth it and as I recall, it helped flush out a couple of bugs we had in our serial port library.

If you just need to verify the communication this one time, there are lots of sample programs with code you can use for displaying incoming data from a serial port - there are several good ones here on CP.

Soren Madsen


这可能会有所帮助:虚拟串行端口驱动程序 [ ^ ]

如果您的计算机上有两个串行端口,那么Sorens的建议可能会更便宜.

最好的问候
Espen Harlinn
This might help: Virtual Serial Port Driver[^]

If you have two serial ports on your computer, Sorens'' suggestion is probably cheaper.

Best regards
Espen Harlinn


这篇关于一个模拟串行设备以测试我的代码的程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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