Author |
Topic |
|
dcx
35 Posts |
Posted - 10 Sep 2004 : 12:16:49
|
Hi,
I am using eVC, WinCE 3.0. Trying to write 100 bytes of data through serial port connected to micro logix as follows.
bResult = WriteFile(m_hComm, //Handle to COMM Port m_szWriteBuffer, // Pointer to message buffer iWriteBuffLen, // Length of message to send &BytesSent, NULL);
While I do this, not all the time the write goes fine. 5% of the time the number of bytes written (BytesSent) is less(random) than what I send out (iWriteBuffLen). (BytesSent) < (iWriteBuffLen)
Any help towards this would be much appreciated.
|
|
akidder
1519 Posts |
Posted - 10 Sep 2004 : 15:01:17
|
Thanks for your note. Could you let us know what build of CE and what product you're using? Thanks! |
|
|
dcx
35 Posts |
Posted - 10 Sep 2004 : 15:10:40
|
Microsoft Windows CE Ver. 3.0 (build 126)
ADS GCPlus Windows CE Ver.(3.50) |
|
|
Susan
123 Posts |
Posted - 10 Sep 2004 : 15:16:47
|
I don't know if this will help, but overlapped I/O (FILE_FLAG_OVERLAPPED) is not supported in WinCE. How are your COM flags (dwFlagsAndAttributes parameter to CreateFile()) set?
I vaguely remember having some difficulty at one time. I don't remember if this was the root of the problem, though.
Oh, forget it. Your overlapped parameter is set to NULL. You know about this. |
Edited by - Susan on 10 Sep 2004 15:30:24 |
|
|
akidder
1519 Posts |
Posted - 15 Sep 2004 : 12:02:51
|
Is it possible to reproduce this problem using the COMTERM sample application we have posted on the forums? To my knowledge, we haven't seen this kind of issue on the GC Plus. |
|
|
wabtec4
59 Posts |
Posted - 17 Aug 2005 : 21:11:34
|
I am using WriteFile on CE /3.0/4.1, my problem is this function outputs to serial port at an inconsistent speed, the variation is too big, for example: WriteFile( hComm, Buf, 200, &Written, NULL ); In most times, it works fine, delay between any 2 bytes is less than 1 ms, but sometimes, I noticed a big gap between 2 bytes, 100th byte & 101st byte for exapmle, up to 1600 ms, what's the problem? Another thread is reading hComm. Thanks,
|
|
|
akidder
1519 Posts |
Posted - 18 Aug 2005 : 11:01:46
|
Thanks for your post, wabtec4. I've responded in a new thread, topic 1963, since your issue is somewhat different topic from this original one. |
|
|
|
Topic |
|
|
|