RS-485 from Windows - Page 2

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Re: RS-485 from Windows
On 2 Jul 2003 09:10:09 -0500, "Jeffrey A. Wormsley"

Quoted text here. Click to load it

Not at all.  If WriteFile blocks, then its thread is suspended by
Windows and stops taking up CPU cycles until the write is completed by
the device drivers, at which time your thread is scheduled for
execution again.  Blocking like this is fine, especially if it is in a
worker thread, as you have done.


-Robert Scott
 Ypsilanti, Michigan
(Reply through newsgroups, not by direct e-mail, as automatic reply address is
fake.)


Re: RS-485 from Windows
snipped-for-privacy@visi.com (Grant Edwards) wrote in

Quoted text here. Click to load it

Yes, I believe that is why my code will eat a bit of CPU time.  It isn't
much, though.  Only at the tail end of the transmission.  I can handle that
tiny burst, since I am not anywhere close to "real time" (as if that term
made sense in Windows).  Other applications, however, may not be able to
tolerate it.  


----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000
Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---

Re: RS-485 from Windows
Quoted text here. Click to load it

I'm doing exactly the same. It has another advantage. You can discover
collisions in certain situations.

Gerard

http://www.stacktools.com





Re: RS-485 from Windows
Quoted text here. Click to load it

This can work in DOS because the application can respond to rx'ed
chars in a timely manner and turn off the transmitter quickly.  But in
Windows, the variable delays in applications means that an application
cannot be sure of responding the rx'ed characters in a timely manner.
If a device on the RS-485 bus chooses to respond to your transmission
fairly quickly, there is a good chance that it will begin its
transmission while your transmitter is still on, resulting in a
collision and lost data.

-Robert Scott
 Ypsilanti, Michigan
(Reply through newsgroups, not by direct e-mail, as automatic reply address is
fake.)


Site Timeline