Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COM port monitoring 1

Status
Not open for further replies.

chpicker

Programmer
Apr 10, 2001
1,316
Is there any way to intercept communications going though your computer's COM ports? My understanding is that only one program can use a port at any given time, but I just want to keep a log of the data going to and from my computer. The computer is running Windows 2000 Professional.

Another "option" would be to set up a computer as a pass-through. It would use 2 COM ports, one that connects to my computer and the other to the device it talks to. It would need a program that would take any data that arrives in either port, make a record of it, and pass it on to the other port. Does anyone know of a program that does this?

Either option would do for what I need. Any suggestions?

Ian
 
Your option 2 could be accomplished with DOS & gw basic if the speed is restricted.
Or you could capture what is on the data lines without the bother of passing thru. Ed Fair
unixstuff@juno.com
Any advice I give is my best judgement based on my interpretation of the facts you supply. Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.
 
The data is only going at 9600bps, so I could probably whip something up in QuickBASIC that would do it if I ended up having to go that route. I'd rather not have to use another computer, though.

How can you capture what is on the data lines? The Windows MSCOMM32 control can't open a port in use, and I don't think Win2k would allow me to do it with a DOS program, either. Or am I mistaken?

Ian
 
You capture data by connecting lines 3 & 7 on your capture computer to lines 2 & 7 of the computer you want to monitor.
You also have to have the handshaking jumpered on your capture machine.
open "i,1,com1:96,n,8,1" as 1
open "data.txt" as 2
input from 1 several ways one character
print #2 the character captured above ;
goto input

example only, it has been a while since I've done it and I don't remember the code. But I've done it a lot capturing data with DOS from unix boxes, either directly or through parallel to serial converter.
You break out when the data has finished.
It also gives you the option of manipulating the data if you need to. Ed Fair
unixstuff@juno.com
Any advice I give is my best judgement based on my interpretation of the facts you supply. Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.
 
Cool, that sounds pretty easy. Does that capture the data going both ways, or just one way? I will need both.

Ian
 
You are monitoring one way per com port used. But there would be nothing to stop you from monitoring both ways using both ports and sequentially inserting the data into one file.
The only problem would be in getting the break point right and not overflowing one channel while manipulating the other.
Might be better (simpler) to keep them separate, tag the data stream with a header, then do a merge of the data streams.
This of course is conjecture since I don't know your application. Ed Fair
unixstuff@juno.com
Any advice I give is my best judgement based on my interpretation of the facts you supply. Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.
 
Thanks Ed...you've been a great help :eek:)

Ian
 
Hi, Chpicker!
I'm trying to find out the same problem solution with the tool ComLite32 Have you ever used this tool? Did you solve your problem with recommended in this tread, or different way?
Now I'm in trouble. I can't force to work ComLite. In my opinion I do all right way, but it doesn't work. If you have any positive experience please let me know.

Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top