Re: Serial comm: Line status error
From: Joseph M. Newcomer (newcomer_at_flounder.com)
Date: 11/05/04
- Next message: Joseph M. Newcomer: "Re: Setting a CStringArray to an existing char or LPCSTR array?"
- Previous message: Krish: "about DlgBar"
- In reply to: Lisa Pearlson: "Serial comm: Line status error"
- Next in thread: Lisa Pearlson: "Re: Serial comm: Line status error"
- Reply: Lisa Pearlson: "Re: Serial comm: Line status error"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 05 Nov 2004 13:09:00 -0500
I've done RS-485 multidrop and hit similar problems. If two devices try to talk at the
same time, they stomp on each other's data, and you get some sort of error report. Exactly
which one you get depends on the way they stomp on each other. Distorting the start bit,
the stop bit, or the data bits produce different effects.
In our system, we actually had to request each unit transmit by broadcasting a "Please,
unit n, tell me your status" type message, so the communication was controlled by the
host, rather than being distributed to the remote targets. There was also a token-passing
protocol that went on among the peer units, but the host controller, when it was
communicating, did a "token seize" and became the master.
However, there are other problems. Win95/8 and NT 4.0 certainly had different bugs dealing
with how RTS/CTS was handled. I forget which one was which at this remove (it has been
about five years since I dealt with this), but one of them would drop the RTS/CTS line
right after it put the last character into the transmit buffer, which meant that the last
character either failed to actually transmit or transmitted incompletely. The other system
failed to raise it in time. The fix that worked for one system would not work on the
other, and you couldn't do it in the application because the response time to schedule the
app was smaller than the device turnaround time in sending the reply, so the result was
that the first part of the reply was lost---and came in as a line status error.
I do not recall if these were fixed in 2000 or XP, but we had to come up with yet another
workaround, which required reconfiguring the RS-485 converter and adding a time delay in
the embedded controller. The alternative was to go to someplace like www.wcsc.net (Egberto
Willies) and buy one of his replacement drivers (at one time he had the only RS-485
multidrop-compatible drivers that existed for Win32 systems).
This is a guy who has forgotten more about serial communications than most other people
have ever learned (including me, and I think I know a lot about it, but Egberto is a
seventh-level wizard!)
joe
On Fri, 5 Nov 2004 13:52:06 +0100, "Lisa Pearlson" <no@spam.plz> wrote:
>When/why does a line-status error occur?
>
>I have some special serial port hardware attached and things work great for
>days, and then once in a while I get a line status error.
>
>My PC actually as an RS-232 to RS-248 converter, which allows me to attach
>many devices in parallel.. where all data on the line is 'heard' by all
>devices, and they themselves must take turns in speaking. They do this at
>regular intervals after the PC requests data, after one another. The devices
>do handle RTS/CTS line status but I am not sure.
>
>Could a line error occur if their communication would overlap? Would that
>not cause a framing error instead or something?
>
>I'd like to know more about why line error's occur.
>
>Lisa
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
- Next message: Joseph M. Newcomer: "Re: Setting a CStringArray to an existing char or LPCSTR array?"
- Previous message: Krish: "about DlgBar"
- In reply to: Lisa Pearlson: "Serial comm: Line status error"
- Next in thread: Lisa Pearlson: "Re: Serial comm: Line status error"
- Reply: Lisa Pearlson: "Re: Serial comm: Line status error"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|