Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020 
<== Date ==> <== Thread ==>

Subject: RE: Are Stream Device protocol clauses atomic?
From: "Gregory, Ray" <gregoryrd@ornl.gov>
To: Mark Rivers <rivers@cars.uchicago.edu>, "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Mon, 30 Apr 2018 20:48:35 +0000

Thank you, Mark. That is a very helpful explanation.

 

--Ray

 

From: Mark Rivers <rivers@cars.uchicago.edu>
Sent: Monday, April 30, 2018 4:44 PM
To: Gregory, Ray <gregoryrd@ornl.gov>; tech-talk@aps.anl.gov
Subject: RE: Are Stream Device protocol clauses atomic?

 

  • I would like to know if protocol clauses for Stream Device protocols are atomic.

 

I believe they are atomic with certain caveats:

 

  • Before the “out” command is executed the input stream is flushed.  This should remove any stale input.
  • The asyn port is locked so that the complete protocol is executed without releasing the lock.  This ensures that 2 records cannot interfere.

 

A problem can occur however if the previous command “in” timed out but the device does eventually send the response.   If it sends its response after the flush before the next “out” command then the response to that “out” command will be the previous response, not the expected response.  You should set the timeout long enough to prevent this.

 

If you are using any stream device records with SCAN=I/O Intr you must be sure that your protocol consumes all of the input from the device.  If not that input could mistakenly be used for another protocol.

 

Mark

 

 

From: tech-talk-bounces@aps.anl.gov [mailto:tech-talk-bounces@aps.anl.gov] On Behalf Of Gregory, Ray
Sent: Monday, April 30, 2018 3:00 PM
To: tech-talk@aps.anl.gov
Subject: Are Stream Device protocol clauses atomic?

 

I would like to know if protocol clauses for Stream Device protocols are atomic. For example, if one thread is processing clause

 

# /// Read the input curve number

getINCRV {

   out "INCRV? \$1";

   in "%d"

}

 

and another thread is simultaneously processing (in the same IOC) clause

 

getInputCurveNumber {

   out "INCRV? \$2";

   in "%(\$1)d";

}

 

can these collide and interfere with each other? Or is there a blocking mechanism to help ensure that the ‘in’ of one clause is really the response to the preceding ‘out’ of the same clause?

 

Thank you,

 

--Ray

 

 


References:
Are Stream Device protocol clauses atomic? Gregory, Ray
RE: Are Stream Device protocol clauses atomic? Mark Rivers

Navigate by Date:
Prev: RE: Are Stream Device protocol clauses atomic? Mark Rivers
Next: Re: NSLS-II Debian Repository in 2018 Anton Derbenev
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020 
Navigate by Thread:
Prev: RE: Are Stream Device protocol clauses atomic? Mark Rivers
Next: Wait for pv to connect sscan l123173
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020 
ANJ, 01 May 2018 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·