windows 伪造 RS232 串口
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1605721/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Faking an RS232 Serial Port
提问by BefittingTheorem
I'm developing a project that has a number of hardware sensors connecting to the deployment machine through RS232 serial ports.
我正在开发一个项目,其中有许多硬件传感器通过 RS232 串行端口连接到部署机器。
But ... I'm developing on a machine without an physical RS232 serial ports, but I would like to make fake serial ports that I can connect to and output data from with the aim of faking input from hardware sensors.
但是......我正在一台没有物理 RS232 串口的机器上开发,但我想制作假串口,我可以连接到它并从中输出数据,目的是伪造来自硬件传感器的输入。
Does anyone know of a way to create a fake serial port and control it on Windows XP?
有谁知道在 Windows XP 上创建假串行端口并控制它的方法?
采纳答案by Frank Bollack
If you are developing for Windows, the com0comproject might be, what you are looking for.
如果您正在为 Windows 进行开发,那么com0com项目可能就是您正在寻找的。
It provides pairs of virtual COM ports that are linked via a nullmodem connetion. You can then use your favorite terminal application or whatever you like to send data to one COM port and recieve from the other one.
它提供了成对的虚拟 COM 端口,这些端口通过零调制解调器连接进行链接。然后,您可以使用您最喜欢的终端应用程序或任何您喜欢的程序将数据发送到一个 COM 端口并从另一个端口接收数据。
EDIT:
编辑:
As Thomaspointed out the project lacks of a signed driver, which is especially problematic on certain Windows version (e.g. Windows 7 x64).
正如Thomas指出的那样,该项目缺少签名驱动程序,这在某些 Windows 版本(例如 Windows 7 x64)上尤其成问题。
There are a couple of unofficial com0comversions around that do contain a signed driver. One recent verion (3.0.0.0) can be downloaded e.g. from here.
有几个非官方的com0com版本确实包含签名的驱动程序。一个最近的版本 (3.0.0.0) 可以从这里下载。
回答by ryyker
I know this is an old post, but in case someone else happens upon this question, one goodoption is Virtual Serial Port Emulator (VSPE) from EterlogicIt provides an API for creating kernel mode virtual comport devices, i.e. connectors, mappers, splitters etc.
However, some of the advertised capabilities were reallynot capabilitiesat all.
我知道这是一篇旧帖子,但如果其他人遇到这个问题,一个不错的选择是来自Eterlogic 的Virtual Serial Port Emulator (VSPE)
它提供了一个用于创建内核模式虚拟通信设备的 API,即连接器、映射器、分离器等。
然而,一些广告的能力是真的没有能力可言。
EDIT
A much better choice, Eltima. This product is fully baked. Good developer tech support. The product did all it claimed to do. Product options include both desktop applications, as well as software development kits with APIs.
编辑
一个更好的选择,Eltima。本产品已完全烘烤。良好的开发人员技术支持。该产品做了它声称要做的所有事情。产品选项包括桌面应用程序以及带有 API 的软件开发工具包。
Neither of these products are open source, or free. However, as other posts here have pointed out, there are other options. Here is a list of various serial utilities:
这些产品都不是开源的,也不是免费的。但是,正如这里的其他帖子所指出的那样,还有其他选择。以下是各种串行实用程序的列表:
com0com(current)
com0com - With Signed Driver (old version)
and, yet another place for com0com with Signed Driver(Pete's Blog)
Tactical Software
Termite
COM Port Serial Emulator
Kermit(obsolete, but still downloadable)
HWVSP3
HHD Software (free edition)
com0com(当前)
com0com - 带有签名驱动程序(旧版本),
以及带有签名驱动程序的 com0com 的另一个地方(Pete 的博客)
战术软件
Termite
COM 端口串行仿真器
Kermit(已过时,但仍可下载)
HWVSP3
HHD 软件(免费版)
回答by Jhollman Cutcsa
I use com0com - With Signed Driver, on windows 7 x64 to emulate COM3 AND COM4 as a pair.
我在 Windows 7 x64 上使用com0com - With Signed Driver来模拟 COM3 和 COM4 作为一对。
Then i use COM Dataport Emulatorto recieve from COM4.
然后我使用COM Dataport Emulator从 COM4 接收。
Then i open COM3 with the app im developping (c#) and send data to COM3.
然后我用正在开发的应用程序(c#)打开 COM3 并将数据发送到 COM3。
The data sent thru COM3 is received by COM4 and shown by 'COM Dataport Emulator' who can also send back a response (not automated).
通过 COM3 发送的数据由 COM4 接收并由“COM 数据端口仿真器”显示,后者也可以发回响应(非自动)。
So with this 2 great programs i managed to emulate Serial RS-232 comunication.
因此,通过这 2 个很棒的程序,我设法模拟了串行 RS-232 通信。
Hope it helps.
希望能帮助到你。
Both programs are free!!!!!
这两个程序都是免费的!!!!!
回答by sjas
Another alternative, even though the OP did not ask for it:
另一种选择,即使 OP 没有要求它:
There exist usb-to-serial adapters. Depending on the type of adapter, you may also need a nullmodem cable, too.
存在 USB 到串行适配器。根据适配器的类型,您可能还需要一条零调制解调器电缆。
They are extremely easy to use under linux, work under windows, too, if you have got working drivers installed.
如果您安装了工作驱动程序,它们在 linux 下非常容易使用,也可以在 windows 下工作。
That way you can work directly with the sensors, and you do not have to try and emulate data. That way you are maybe even save from building an anemic system. (Due to your emulated data inputs not covering all cases, leading you to a brittle system.)
这样您就可以直接使用传感器,而不必尝试模拟数据。这样你甚至可以避免建立一个贫血的系统。(由于您模拟的数据输入并未涵盖所有情况,导致您的系统很脆弱。)
Its often better to work with the real stuff.
使用真实的东西通常会更好。
回答by Bryce
There's always the hardware route. Purchase two USB to serial converters, and connect them via a NULL modem.
总是有硬件路线。购买两个 USB 转串口转换器,并通过 NULL 调制解调器连接它们。
Pro tips: 1) Windows may assign new COM ports to the adapters after every device sleep or reboot. 2) The market leaders in chips for USB to serial are Prolific and FTDI. Both companies are battling knockoffs, and may be blocked in future official Windows drivers. The Linux drivers however work fine with the clones.
专业提示:1) Windows 可能会在每次设备休眠或重启后为适配器分配新的 COM 端口。2)USB转串口芯片的市场领导者是Prolific和FTDI。两家公司都在与仿冒品作斗争,并且可能会在未来的官方 Windows 驱动程序中被阻止。然而,Linux 驱动程序与克隆一起工作得很好。
回答by Nileshkumar koladiya
i used eltima make virtual serial port for my modbus application debug work. it is really very good application at development stage to check serial port program without connecting hardware.
我使用 eltima make 虚拟串口来调试我的 modbus 应用程序。在开发阶段,无需连接硬件即可查看串口程序确实是非常好的应用。