Click here to Skip to main content
15,885,127 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi,
I am working on an industry project which is using RS-232 as communicaion media.

Because the inconvenience in debugging the communication procedure, I want to develop a little tool to monitor RS-232 packages when the working program is communicating with hardware.

My question is: How can I open the RS-232 port that is already opened by other program?

Can anyone give me some ideas??

Thanks!
Posted
Updated 30-Jan-11 20:50pm
v2

I have a very different suggestion, and this is because I also work in the industry and no how many problems can be hidden inside communication chains.
Monitoring of communications with hardware is very common. You probably want to spy on RS-232, and this can be extremely useful if you want to reverse engineer communications performed by software/firmware not accessible to you. That's why I voted "5" for your question. (I almost forgot, there is an application to monitor it: please see my other answer.)

However, in case you want to monitor your own software, you need to embed a tool for optional monitoring permanently into you low-level communication functions. I think, this is your case, because you mention inconvenience in debugging, but you did not say it is impossible. One of the best and non-intrusive ways of monitoring without debugger is writing to the system event log.

For a more advanced example, I recently developed a framework for development of Windows Services through the application working in dual-mode: as a Windows Service and a GUI (additionally, as a service installer). So the options could separately switch on/off logging in the UI control or System event log on different level of verbosity. If you create such a fundamental tooling for all your communications, it will pay off later because of massive diagnostics/debugging problems you may face down the road, I'll guarantee that.

Good luck,
—SA
 
Share this answer
 
v2
Comments
Espen Harlinn 31-Jan-11 15:17pm    
Good effort 5+
You may want to look at using Portmon[^].
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 31-Jan-11 1:21am    
Steve, please tell me, did you down-voted my answer because you came up exactly with the same answer sooner? I simply did not see that, I don't know why...
If, so, I will gladly remove mine and vote "5" for yours.
You just needed to explain, nothing else...
Respect,
--SA
Steve Maier 31-Jan-11 2:17am    
I did not down vote you at all. The only times I do that are when something is bad and your answers are not bad. The fact that more than one of us suggested portmon means it really is good as we both know. ;-)
Sergey Alexandrovich Kryukov 31-Jan-11 2:19am    
Absolutely. I'll remove mine because duplicates are not needed.
My 5.
--SA
JF2015 31-Jan-11 2:20am    
Good answer.
Espen Harlinn 31-Jan-11 15:17pm    
Good answer, 5+
Serial Port Monitor download from here, am using this from past 5 Years

Here[^]

Trick: SerialPort Monitor is not a Free Version.., after completion of your evaluation Period also you can use it by changing your system date..,
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 31-Jan-11 1:17am    
I have no idea who voted "1" and why; certainly not OP. I voted "5" because I think it's good.
--SA

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