g+
g+ Communities
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  <20122013  2014  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014 
<== Date ==> <== Thread ==>

Subject: RE: Record processing: periodic vs. push vs. pull
From: Emma Shepherd <Emma.Shepherd@synchrotron.org.au>
To: "jon@u.washington.edu" <jon@u.washington.edu>, "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Fri, 21 Dec 2012 10:26:10 +1100
Hi Jon,

It's an interesting question, and I'm sure the 'best' solution (if there is one!) will depend on your application.

When I am doing serial comms e.g. StreamDevice, I try to keep the number of periodically scanned records to a minimum.  For example, I might use a fanout record with SCAN .5 second linking to PASSIVE records which actually do the work.  This means that if I want to change the scan rate I only need to change a single record, or I can turn off comms altogether by disabling just this one record.

I've personally never used the PHAS field, and someone can correct me but I think this is not usually recommended?

As for 'push' vs 'pull', I'm never quite sure which to use either.  Unless I really need event driven processing (e.g. to catch every update from a device), I usually tend towards the pull approach.  I find this is best for flexibility for adding functionality later on, otherwise I end up with long chains of FLNKed records which I try to avoid as it creates dependencies between tasks which are not necessarily related.

Just my thoughts on the subject anyway!

Cheers,
Emma

> -----Original Message-----
> From: tech-talk-bounces@aps.anl.gov [mailto:tech-talk-
> bounces@aps.anl.gov] On Behalf Of jon@u.washington.edu
> Sent: Friday, 21 December 2012 5:30 AM
> To: tech-talk@aps.anl.gov
> Subject: Record processing: periodic vs. push vs. pull
> 
> 
> 
> One of the EPICS Getting Started slide decks (ref below) discusses
> alternatives for record processing in a chain of three records where
> data flows: ai VAL -> INPA calc VAL -> DOL ao.  The alternatives are:
> 
> 1. Periodic: all three records have SCAN .1 second, with advancing
> phase:
>     ai PHAS 0 -> calc PHAS 1 -> ao PHAS 2
> 
> 2. Push: input ai record is periodic, others are passive, with forward
> links:
>    ai FLNK -> calc FLNK -> ao
> 
> 3. Pull: output ao record is periodic, others are passive, with input
> links
>     INP and DOL with PP attribute (here arrows show control not data
> flow):
>     ai <- INPA PP calc <- DOL PP ao
> 
> I wonder how to choose among these.  I can think of these pros and
> cons:
> 
> 1. Periodic
> Pro: i. Record definitions do not depend on control flow, no INP PP or
> FLNK
>      ii. No control flow subtleties, records always processed on fixed
> schedule
> Con: i. Processing occurs on fixed schedule, regardless of events or
> demand
>      ii. Might have to tweak control flow after all, with PHAS
> 
> 2. Push
> Pro: i. Processing can be driven by events, when data appears or
> changes
>          (in input ai, replace SCAN .1 second with I/O Intr or ...)
> Con: i. Input record definitions depend on downstream data processing
>          (must anticipate where data will be consumed to define FLNK)
> 
> 3. Pull
> Pro: i. Processing can be driven by demand
>          (in output ao, replace SCAN .1 second with input from FLNK or
> ...)
>      ii. Input record definitions do not depend on downstream
> processing
> Con: i. Control flow may be difficult to analyze or understand, for
> example
>          INP PP gets old value instead of waiting for asynchronous
> completion
>          INP PP flag ignored in CA links (to other IOCs), behaves like
> NPP
> 
> Have I overlooked any important pros or cons?  Is there one alternative
> that is more common, or one that is recommended (or discouraged)?
> 
> Jon Jacky
> 
> PS - The three alteratives appear in slide 29, "Processing chains", in:
> 
> What is an EPICS database?  Andrew Johnson  2004
> http://www.aps.anl.gov/bcda/epicsgettingstarted/iocs/Database1&2_1up.pd
> f
> 



References:
Record processing: periodic vs. push vs. pull jon

Navigate by Date:
Prev: CSS XY Graph Pause John Dobbins
Next: Re: CSS XY Graph Pause Pavel Maslov
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014 
Navigate by Thread:
Prev: Record processing: periodic vs. push vs. pull jon
Next: Re: Record processing: periodic vs. push vs. pull Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICSv4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·