Click here to Skip to main content
15,890,609 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I need to monitor a serial comunication between my computer and an external device so I can take some actions when specific data is sent from the external device.

I was looking for a serial port monitor that I could make some changes or some document with the approach to follow but can't seem to find any.

Ideas?

Thanks in advance!
Posted
Updated 22-Dec-10 0:30am
v2
Comments
Dalek Dave 22-Dec-10 6:30am    
Edited for Grammar and Readability.
OriginalGriff 22-Dec-10 9:28am    
Answer updated

The simplest approach is just to set up a SerialPort (see MSDN[^] for the basics) then attach a handler to the SerialPort.DataReceived event MSDN example[^].

You could have found this with a simple Google...

"If I set up the serial port the way presented in MSDN will i be able to open the same port with another app?
Not sure if I explained right, but i need to monitor (with my app) the serial communication between another app in my computer and an external device.
"

No. The normally, a physical Serial Port is a two - device link, and the SerialPort control mimics this. When the port is open, it can only be accessed by a single process on the entire machine - which makes sense, if you think about normal operations. You don't want data being read by two devices simultaneously because you would not get repeatable results.

You have two options: go with SerialPort Monitor that Rajesh suggested - I've never heard of it, so I can't comment on wetehre it would work - or go with a physical solution and wire the incoming data to two serial ports on the same PC. RS232 isn't supposed to be used like that, but it will do it provided you keep the number of machines to two or three (I have had six, but don't recommend it) and only wire up the RX and earth leads. Do not wire up TX or flow control - loop them back if you must instead.
 
Share this answer
 
v2
Comments
jbravofaria 22-Dec-10 9:13am    
If I set up the serial port the way presented in MSDN will i be able to open the same port with another app?

Not sure if I explained right, but i need to monitor (with my app) the serial communication between another app in my computer and an external device.
Download SerialPort Monitor

Here[^]

Tip : SerialPort Monitor is not a Free Version.., after completion of your elevationevaluation Period also you can use it by changing your system date..,
 
Share this answer
 
v2
Comments
fjdiewornncalwe 22-Dec-10 9:47am    
Sorry Rajesh... I had to update your answer only because I was laughing too hard at the elevation instead of evaluation part.
Rajesh Anuhya 22-Dec-10 23:31pm    
Thanks..,
If you want a truly free serial port monitor, use this one:

http://www.serial-port-monitor.com/[^]

I use it all the time for my projects and it works great.

David
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900