Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

cannot open com port

Whilst trying to open a RS232 COM port in my application, I get the message 'cannot open port'. This is because another application in Windows has already opened the same port, crashed and failed to close the port. I realise I cannot open the port if another program has already failed to close it.

My question is: is there a way of closing a COM port that is already open (thinks its open) in another Windows application? Is there a low level command perhaps that I could send to force the COM port to close or at least think it was closed so that I could then open it in my application?

 

 

0 Kudos
Message 1 of 4
(5,426 Views)

Hi Steve,

 

You wont be able to use LabVIEW to close the COMM port after it's been opened by another application.  LabVIEW will need to generate a handle to the port which it wont be able to do when it's still open.  You may be able to close the port in Windows manually but my initial research did not yield any definative results.  

 

I would be interested to hear your eventual solution.

 

Regards,

 

Tom Clark

Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 2 of 4
(5,395 Views)

sir i m using topcon total station old model 235n while using the machine uploding data i recieve the message can not open COM port .Port is already open by another programme.

0 Kudos
Message 3 of 4
(2,341 Views)

@syed1979 wrote:

Port is already open by another programme.


That's your problem.  A serial port can only be opened by one application at a time.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 4
(2,331 Views)