Maypeur
Maypeur

Reputation: 396

ReadFile Rs232 Too Slow

I have a problem executing my program on Windows 8; i use ReadFile to retrieve data from RS232 serial port.

My code is working since many year on OS from windows Xp to Win 7 without any problems, but now the ReadFile opertion took always between 94 and 100ms while it was very fast or immediatly on precedent OS :

I have try modifying my timeouts to force 1ms but it is always the same results :

GetCommTimeouts(Handle, &cto);
cto.ReadIntervalTimeout=MAXDWORD;
cto.ReadTotalTimeoutMultiplier=0;
cto.ReadTotalTimeoutConstant=0;
cto.WriteTotalTimeoutMultiplier=0;
cto.WriteTotalTimeoutConstant=0;
if(SetCommTimeouts(Handle, &cto) == 0)

// And the read function :
rOL.Offset = 0;
rOL.OffsetHigh = 0;
if (ReadFile(Handle, &byte, 1, &i, &rOL) == TRUE)

I don't find any solution after reading a lot of post and all the MSDN!

Upvotes: 2

Views: 1435

Answers (2)

Maypeur
Maypeur

Reputation: 396

After a while, here is the 32bits driver (only the x86 driver is included in the precedent zip).

Prolific driver x86 3.3.11.152 :

http://www.allendatagraph.com/techsupport/usb/SetupBafoDriverWindow.exe

Upvotes: 0

Maypeur
Maypeur

Reputation: 396

I find and correct my problem, thanks to Hans Passant wich indicate me the right way !

So it's a driver issue, the big problem is that the latest Prolific driver made specially for Windows 8 and 7 and available on Windows Update and catalog.update.microsoft.com is buggy :

So i downgrade to the 2010/12/03 version and now it's working perfectly.

I made a procedure and you can find the working driver in this zip :

http://www.soft-control.com/media/exe_soft/sav/ProlificDowngrade.3.11.zip

I hope it will help anyone else who concerning by this problem !

Upvotes: 1

Related Questions