Comm Port setup not complete

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

I am using a serial port to communicate with an embedded device. I am using CreateFile, WriteFile & ReadFile. It all works great until I run a VB6 application that uses the serial port. After I run the VB6 application, the ReadFile no longer waits for a character, it simply falls through. If I open HyperTerm and close it, again my app works.

CreateFile, GetCommState, SetupComm, SetCommState & PurgeComm all return successfully. Any ideas

Thanks
Pete
 
PeteC said:
I am using a serial port to communicate with an
embedded device. I am using CreateFile, WriteFile
& ReadFile. It all works great until I run a VB6
application that uses the serial port. After I run the
VB6 application, the ReadFile no longer waits for
a character, it simply falls through. If I open
HyperTerm and close it, again my app works.
CreateFile, GetCommState, SetupComm, SetCommState & PurgeComm all return
successfully. Any ideas?

I would suggest that you take a look at SetCommTimeouts(), too.

If that fails you, I'd double check the return codes from each of the
functions. It seems as though one or more may have no effect and that
HyperTerminal is actually setting the prort's state.

Regards.
Will
 
Back
Top