EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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

Subject: Re: Record support question
From: Benjamin Franksen <[email protected]>
To: [email protected]
Date: Mon, 01 Mar 1999 14:37:19 +0100
Jennifer Dunn wrote:
> I am creating a custom record, and have defined a field in the record to
> have special processing at run time (special = SPC_MOD) and have the pp_value
> set to YES (a passive record should be processed when Channel Access writes
> to this field).
> 
> In the record support code I have a routine called special, that simple sets
> a flag to indicate that the record was accessed - and then expect that
> after special the "process" routine should be called.
> 
> Well, this appears to work as expected - most of the time.  Sometimes I
> see that special is called and then some time later - much later -
> the process gets called by "scanOnce".  This is a problem because I
> set a timer (using the watchDog timer lib - wdLib), to keep time and tell
> me if I have waited too long - and this times out before the process
> gets called.
> 
> So, sequence of events is:
> 
> -start watchdog timer at time <72103>
> -value written to SPC_MOD field <73003> in an interrupt routine from a different
> record.
> -special is executed and flag gets set <73003>
> -then some time later the watchdog timer finishs <73904> and the callback
> routine gets called.
> -and immediately following the process gets called as a result of the
> special being executed, but this is much too late <73904>.

Marty Kraimer wrote:
> process is not called as a result of a put to a special field.
> If you want the record processed then, after the second call to special, call
> scanOnce.

This is beside the point, since the field is PP and presumably written
to via a dbPutField call. But:

Tim Mooney wrote:
> You don't want to do this.  If you call dbPutField (for a process-passive field)
> from an interrupt routine, the record will get processed at interrupt level.
> You shouldn't do anything at interrupt level that you can avoid doing there.

Absolutely right. I'd say it's better to call scanOnce from the
interrupt code or from the special routine as Marty suggests.

On the other hand you state

> ...the process gets called by "scanOnce".

dbPutField calls dbProcess directly and does _not_ call scanOnce. So:
who calls scanOnce on your record, if not your interrupt routine?

A possible explanation could be the following: When the interrupt
routine calls dbPutField, dbProcess tries to process the record, finds
that it is active (PACT==TRUE, for whatever reason) and returns after
setting the RPRO flag (repocessing). Later, when the watchdog timer
expires, process is being called again and recGblForwLink causes
reprocessing by putting the record into the scanOnce queue. This is then
what you observe as processing immediately after the callback routine is
performed (which, presumably, calls the record's process routine).

Questions remain:

- Why is the record active in the first place?
- Why don't you see the record being processed twice, when the wd timer
expires, but only once?

Ben
-- 
The Notorious Neb Nesknarf
---------------------------------------------------------------------
@BESSY II: fax: +49 30 6392-4859 phone: +49 30 6392-4865
---------------------------------------------------------------------
keep the listeners happy: BND MAD Waffen Lieferung ETA Lybien IRA CIA 
Iran killer Heroin kommunistische Befreiungsfront RAF PKK Irak Kurden

References:
Record support question Jennifer Dunn

Navigate by Date:
Prev: Re: ASLO initial values Ralph Lange
Next: HP-UX 10.20 (hp700) Extensions Binaries Ralph Lange
Index: 1994  1995  1996  1997  1998  <19992000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Record support question Marty Kraimer
Next: Re: Record support question Tim Mooney
Index: 1994  1995  1996  1997  1998  <19992000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·