Member Login
member
passwd
remember me on
this computer.

- join now -
- forgot username or password? -

Search

Jump to a Date

Sponsored Communities
Cool stuff
Select a topic of interest:
...and press:
Neat Stuff
Control.com Stuff

Visit our shop for nerds in control lifestyle products.

Fortune
You look like a million dollars. All green and wrinkled.
RSS Feed
RSS feed Use this link to get an RSS feed of the Control.com article flow, for private, non-commercial use only:
www.control.com/rss/
To get a personalized feed, become a member at no cost.
Select a Page Style
Select one of the following styles:
- BluFu
- Classic
(cookies required)
advertisement
from the Automation List department...
RS232 write operation
Communications systems and equipment. topic
Posted by pv_srt on 14 November, 2007 - 12:40 am
Hi everyone,

I am writing buffers to the serial port one after the other in a sequence. But since the write operation cannot finish and a new buffer becomes available for writing, some of my buffers are lost.How can I make sure that all my buffers are written and none of them is lost?

I tried to use Sleep() after each write operation to let the WriteFile() function finish writing, but it does not seem to help. Please advise.

Thanks in advance.


Posted by Michael Griffin on 14 November, 2007 - 11:50 pm
Your description is a bit unclear, but it sounds like either the output buffer on the sending end or the input buffer in the receiving end is overflowing
because you are filling the buffer faster than it can empty. The problem is usually at the receiving end, since most serial libraries block if the sending buffer is full.

1) Find out which end the data is being lost at.

2) Try using a bigger buffer.

3) Check your flow control settings and wiring.

From Control Engineering magazine...
Related articles from Control Engineering magazine
Above articles copyright 2008 Reed Business Information. Subject to its Terms of Use.
Your use of this site is subject to the terms and conditions set forth under Legal Notices and the Privacy Policy. Please read those terms and conditions carefully. Subject to the rights expressly reserved to others under Legal Notices, the content of this site and the compilation thereof is © 1999-2008 Control Technology Corporation. All rights reserved.

Users of this site are benefiting from open source technologies, including PHP, MySQL and Apache. Be happy.

Internet Explorer 6.0 Fix

Advertisement
Our Advertisers
Help keep our servers running...
Patronize our advertisers!