是否可以配置串行连接以在收到 RD 信号时启动程序?
我目前正在尝试使用硬件握手通过 COM1 端口进行串行连接 (RS232) 编程。 操作系统是 Windows XP 32,我计划使用 C++ 对其进行编程(使用 .NET 串行端口类)。 然而,我目前想到的唯一方法是在启动时运行一个小程序,该程序不断检查串行端口,直到接收到直接数据(通过 RxD 引脚)。 我想知道是否可以配置端口,以便在收到 RD 信号后打开我的程序。 这是可能吗?
感谢您提供的任何帮助, 缺口
I am currently attempting programming for a serial connection (RS232) through the COM1 port, using hardware handshaking. The OS is Windows XP 32, and I was planning on using C++ to program this (using the .NET serialport class). However, the only way I can currently conceive of doing it is by having a minor program running on start-up, which is continually checking the serial port until direct data is received (through the RxD pin). I was wondering if it's possible to configure the port such that it will open my program once the RD signal is received. Is this at all possible?
Thank you for any help you can give,
Nick
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以创建一个简单的串行端口驱动程序,该驱动程序在 RD 信号上中断,并让一个 Windows 服务监视串行端口,该服务将从驱动程序接收事件以启动您的程序。
或者,根据数据的速度,您可以简单地轮询串行端口以获取 RD 信号。
You could create a simple serial port driver which interrupts on RD signal, and have a windows service monitoring the serial port which would receive events from the driver to initiate your program.
Alternatively, depending on the speed of your data, you might be able to simply poll the serial port for RD signal.