Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to open a single com port from two or more applications. can anyone provide a some code or any link for achieving this in .net? I am searching the internet from last two days but, could not find any solution. I know, it is possible, because i have some applications that do this work. But, i have to write this functionality in my own application.

Thanks in advance.
Posted
Updated 17-Jan-13 20:29pm
v2
Comments
Sergey Alexandrovich Kryukov 18-Jan-13 2:28am    
Why?!
—SA
AnkitGoel.com 18-Jan-13 2:33am    
i have to trace the communication between an existing application and some manufacturing machine.
lukeer 18-Jan-13 2:56am    
Say you had the monitoring software already working, you could as well solder some special man-in-the-middle-three-plug-wire to listen to communication in one direction or the other.
Jochen Arndt 18-Jan-13 3:09am    
To trace the communication, use a serial port sniffer / monitor. Using the last three/four words you will get a lot of search hits including free utilities. An example application in C++ can be found here at CP: http://www.codeproject.com/Articles/311159/SIMPLE-SERIAL-PORT-MONITOR. It's not .NET but it explains how monitoring can be done.
AnkitGoel.com 18-Jan-13 3:19am    
thanks but, it could not work.

1 solution

You can not have more than one process opening a com port. If port is opened by a process, other process will simply not be able to open it. Best bet is to use simple TCP/IP, open the port from a server program, from other applications, interact with the server.
 
Share this answer
 
Comments
AnkitGoel.com 18-Jan-13 3:02am    
AS i already said, i am able to open a port multiple times using a third party application. but i want to do it in my own code to make it user friendly.

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