Forum Index > Comm64 won't Open a busy Com port?

By: JamesT Posted on: Feb 15 2013 at 03:30:10 AM
Hi

This is an odd and specific problem. But on the chance that someone may have a solution!

I have a device attached to COM4 (a USB serial port). I have a process on the device which fires back data continuously.

On Hyperterminal I can:
1) Open the COM port/connection.
2) Start the process.
3) See the device sending back the data in a continuous sequence.
4) Close the connection.
5) Open the connection again.
6) See the device sending back the data in a continuous sequence.
7) Stop the process (stops sending data)
8) Close the connection.

Using COMM64 in my application I can do items 1 to 4 above.

However, when I come to step 5) Open com port COM4 again I get the following Comm64 error: "Comport could not be opened. Runtime Error 8002."

I'm at a loss to understand why Hyperterminal just works and Comm64 doesn't.

Note: When I try the application with Comm64, Hyperterminal is closed so is not hogging the Com Port !

Any help appreciated.
Thanks




By: Guest Posted on: Feb 15 2013 at 12:56:34 PM
I'm not 100% sure but I believe that hyper terminal uses TAPI (Telephony API) Whereas Comm64 probably uses the windows Comm/File IO API.

In that case there would be differences.

I don't know how TAPI works but with Comm64 using the Windows file io api it probably causes the USB driver to hang when it tries to close the file handle. Well, the handle is released but the underlying USB driver is still handling the incoming data so fails next time you try to open the port.

If the external device is watching cts you could try dropping RTS just before closing the port.

 

Reply - add comment to this topic
You may enter letters, numbers and standard punctuation only. HTML and other scripts/tags will be rejected
  Topic:- Comm64 won't Open a busy Com port?

Your Name


 


Forum scripts and databases - Copyright (c) 2009 - 2012 AxCoL.com