08-10-2006 08:24 AM
08-10-2006 09:50 AM
In general you can not have a single serial port accessed by two different programs when calling OpenCom(). Concurrent access by multiple programs is not a supported feature. Most serial sniffer programs work by replacing the serial port driver with something that does allow access. If you need to monitor a serial port you have a few options:
Use a serial port monitor/sniffer program.
Create a DLL to replace the Comm interface library the application uses and implement each Comm function yourself with the hooks to allow monitoring of the send and receive buffers. This would require linking your DLL into the application to over ride the existing serial interface calls.
Use another pair of serial ports to implement your own serial monitor. This is a very simple way to monitor a serial application. You simply route the serial interface cable through the hardware of two additional serial ports, which can be on the same PC or another system. You set the two serial ports up as a data pass through pipe. What comes in one goes out the other. Since you are handling these ports with your own sniffer application you have full access and control over the data flow.