Hello,
I'm trying to trigger a scanner and read the read data over a serial connection.
Triggering by a short message and reading the data works fine but is very slow.
After reading the data, I want to trigger again, but I get no result. I have to wait aprox. 200ms Sleep(200). When I trigger after that time, I get a result. When I don't wait, my scanner delivers no data back.
What could be the problem?
I assume maybe the timeouts are the problem? But I set it to:
COMMTIMEOUTS timeouts;
timeouts.ReadIntervalTimeout = MAXDWORD; // MAXDWORD
timeouts.ReadTotalTimeoutMultiplier = 0;
timeouts.ReadTotalTimeoutConstant = 0;
timeouts.WriteTotalTimeoutMultiplier = 0;
timeouts.WriteTotalTimeoutConstant = 0;
and no success.
I raised the thread priority from THREAD_PRIORITY_NORMAL up to THREAD_PRIORITY_TIME_CRITICAL but also no success.
Anyone a Idea? I don't know how to speed up my reading.
Thanks a lot in advance