質問

I am writing two applications one is continuosly listening to "COM3" port and printing data.

When i run other application which should write to that "COM3" port i am getting error serial port does not exist for writing.

can 2 applications open handle to access the same serial COM port in our system at the time

役に立ちましたか?

解決

This is not possible, Windows doesn't allow a serial port to be shared between processes. Once one process opens a port, another will get error 5 (access denied) when it tries to open the same port. Serial ports are far too primitive to allow any kind of sharing protocol.

You need a null modem. Either in hardware by using two ports, connect RxD to Txd. Or in software, a device driver that emulates serial ports. Like this one.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top