EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  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  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: CALC record monitors
From: Andrew Johnson <[email protected]>
To: [email protected]
Date: Tue, 3 Feb 2009 10:29:42 -0600
Hello Kay,

On Tuesday 03 February 2009 09:20:06 Kasemir, Kay wrote:
>
> I ran into a problem with not getting the expected CA monitors
> from a calc record.
> It's a simple calc record meant to count whenever it's processed.
> To reset the counter, we write 0 to its VAL field:
>
> record (calc, "XYZ_Cnt")
> {
>     field (INPA, "XYZ_Cnt")
>     field (CALC, "A+1")
> }
>
> Many times, that works OK. But at least with R3.14.8.2,
> it omits the monitor for the initial count from 0 to one
> after a reset.

...

> In general, simply performing a "caput XYZ_Cnt.VAL 0"
> seems to leave the calc's MLST where it was.
> I assume that's because Channel Access & the database code
> directly update the VAL field without triggering the CALC's
> process routine.

The VAL field of a CALC record is not marked PP, so writing to it from CA does 
not cause the record to process.  If it did, your reset operation (putting a 
0 to it) would actually result in VAL becoming 1 because it would read the 
zero and immediately increment it.

> The "fix" for me is to set MDEL=-1, always getting monitors
> even though the record's idea of the last value, MLST,
> is wrong.

Right.  Note that the "bug" only occurs if you reset the counter when its 
value is a 1.

- Andrew
-- 
The best FOSS code is written to be read by other humans -- Harold Welte

References:
CALC record monitors Kasemir, Kay

Navigate by Date:
Prev: Re: boot vxworks from ppcbug in mv5100 Andrew Johnson
Next: Re: wrong timestamps in monitors Maren Purves
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: CALC record monitors Kasemir, Kay
Next: MaxP PCI motor interface Dalesio, Leo
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 31 Jan 2014 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·