EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Out of order replies from a serial device
From: Phillip Sorensen <[email protected]>
To: TechTalk EPICS <[email protected]>, [email protected]
Date: Mon, 22 Jan 2007 16:06:07 -0500
Phillip Sorensen wrote:

I took some time to look at the asyn code this morning. I am looking at ASYN 4-6.

Mark Rivers wrote:
I believe asyn is doing the flush operation that Emmanuel suggested.


As far as I can tell, there is no flush before writes at either the devGpib level or the port driver level for drvAsynSerialPort or drvAsynIPPort. What I did find was that in the drvAsynSerialPort.c file that a timeout at this level causes a flush. There is no similiar flush in the drvAsynIPPort.c code.


I suspect you are not getting out of order replies. I think you are getting a timeout, but then stale data from some buffer is ending up in the apparent data you received with the timeout.

The "out of order" data seems to be coming from the OS socket buffer (I am running under linux). They are never flushed after a timeout.


This looks like a "possible" bug to me, and think that flushing the buffer would do away with my "out of order error", BUT I don't think it is the root cause of my problem.

After taking a second look at the code, I think I have found the root of my problem. I was puzzled by the fact that the code seemed to work with an older version of ASYN and that increasing the timeout parameter had no effect on the problem.

It appears that when the timeout handling code was removed from the drvAsynIPPort driver the SOCK_EINTR error return from the recv is now treated as if it were a timeout. In the previous version of the code that I have and in the drvAsynSerialPort code, the recv was inside a for(;;) loop which would retry the read in the EINTR error state.

I will try to put together a patch to retry to the recv on SOCK_EINTR in the next day or so.


Phil Sorensen CHESS


Replies:
Re: Out of order replies from a serial device Dirk Zimoch
References:
Out of order replies from a serial device Phillip Sorensen
Re: Out of order replies from a serial device Emmanuel Mayssat
Re: Out of order replies from a serial device Phillip Sorensen
RE: Out of order replies from a serial device Mark Rivers
Re: Out of order replies from a serial device Phillip Sorensen

Navigate by Date:
Prev: Re: EPICS Driver for motor through Ethernet/Serial? Pete R. Jemian
Next: Switchable Links Robert Emery
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Out of order replies from a serial device Phillip Sorensen
Next: Re: Out of order replies from a serial device Dirk Zimoch
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Nov 2011 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·