How can I monitor data on a serial port opened by another application?
-
Using visual C++, can I monitor data on a serial port opened by another application? I have an application that recieves data from a comm port. I want to write a program to idependently monitor the data that is recieved on this port, and (depending on the data) write it to a file. I don't have source to the application. Is it possible to transparently view the data on a comm port like this? I've tried using CreateFile() to get access to the port, but I get a "port in use" error. Any help appreciated. Thanks Jim
-
Using visual C++, can I monitor data on a serial port opened by another application? I have an application that recieves data from a comm port. I want to write a program to idependently monitor the data that is recieved on this port, and (depending on the data) write it to a file. I don't have source to the application. Is it possible to transparently view the data on a comm port like this? I've tried using CreateFile() to get access to the port, but I get a "port in use" error. Any help appreciated. Thanks Jim
IamJimW wrote: I've tried using CreateFile() to get access to the port, but I get a "port in use" error As far as I know, there's no way to do this. It's possible a replacement serial port driver could support something like this. It's probably easier to use a 'breakout' program on another PC, listening to the RS-232 traffic via a 'Y' cable. Take a look at this[^], for example.
Software Zen:
delete this;
-
Using visual C++, can I monitor data on a serial port opened by another application? I have an application that recieves data from a comm port. I want to write a program to idependently monitor the data that is recieved on this port, and (depending on the data) write it to a file. I don't have source to the application. Is it possible to transparently view the data on a comm port like this? I've tried using CreateFile() to get access to the port, but I get a "port in use" error. Any help appreciated. Thanks Jim
Jim, I don't know how to do this from Visual C++, but I believe that it can be done. A product that I purchased not too long ago does just that. It is called "Advanced Serial Port Monitor" and is available from here: http://www.aggsoft.com/products/supercom/ I believe they also offer a software development kit that might be just what you need. The product is great too. Robert
-
Jim, I don't know how to do this from Visual C++, but I believe that it can be done. A product that I purchased not too long ago does just that. It is called "Advanced Serial Port Monitor" and is available from here: http://www.aggsoft.com/products/supercom/ I believe they also offer a software development kit that might be just what you need. The product is great too. Robert
Check out PortMon at sysinternals.com I don't think they give away the source, but they do talk in detail about inserting a driver to intercept such stuff. That is probably what you need. Or you could brute-force it by reading the window displayed by PortMon. But that sure would be ugly! Good luck!
-
Check out PortMon at sysinternals.com I don't think they give away the source, but they do talk in detail about inserting a driver to intercept such stuff. That is probably what you need. Or you could brute-force it by reading the window displayed by PortMon. But that sure would be ugly! Good luck!