Click to See Complete Forum and Search --> : Serial Communication ( reading problem )


June 3rd, 1999, 07:40 AM
I've done a class that communicates with the serial port. The problem is that for some reason after booting the machine and starting my program, I cannot receive anything, but I can send bytes to the port. So for it to work, I open up a HyperTerminal on the com port and write in it. After that I start receiving information from the port.

Info on the program:

I open the com port with an overlapped structure to have asynchronous reading and writing. I use ReadFile and WriteFile with an Overlapped structure.

Thanks in advance.

Jason Phillips

Radman
June 3rd, 1999, 11:25 PM
this is kind of a stupid question, but did you initialize the port correctly and set the baud, parity, stop bits and all that to the correct values????

Word,
Ryan "Radman" Du Bois

June 4th, 1999, 03:11 PM
Actually I found the problem.

I did not initialize the COMMTIMEOUTS structure. So it seems that after booting up the machine, the COMMTIMEOUTS must be set so that it never reads the port, or something. But it works great now.

Thanks,

Jason Phillips