All Forums
 Microsoft Windows CE
 eVC Application Development
 Serial Comm - WriteFile() Problem
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

dcx

35 Posts

Posted - 10 Sep 2004 :  12:16:49  Show Profile  Email Poster
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  Show Profile  Email Poster
Thanks for your note. Could you let us know what build of CE and what product you're using? Thanks!
Go to Top of Page

dcx

35 Posts

Posted - 10 Sep 2004 :  15:10:40  Show Profile  Email Poster
Microsoft Windows CE Ver. 3.0 (build 126)

ADS GCPlus Windows CE Ver.(3.50)
Go to Top of Page

Susan

123 Posts

Posted - 10 Sep 2004 :  15:16:47  Show Profile  Email Poster
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
Go to Top of Page

akidder

1519 Posts

Posted - 15 Sep 2004 :  12:02:51  Show Profile  Email Poster
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.
Go to Top of Page

wabtec4

59 Posts

Posted - 17 Aug 2005 :  21:11:34  Show Profile  Email Poster
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,
Go to Top of Page

akidder

1519 Posts

Posted - 18 Aug 2005 :  11:01:46  Show Profile  Email Poster
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.
Go to Top of Page
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.03 seconds. Snitz Forums 2000