Hello community, hello Andrew,
we are using Epics 3.14.11 at the moment but in the newest 3.15 release
the here discussed behavior is the same. We recently recognized that
when archiving OVAL fields, ADEL can not be used to limit the fleet of
data. So I looked into the code and found some things worth to improve, imo.
I think OVAL must be handled the same way as VAL. Like VAL has its ALST
and MLST, OVAL needs its own fields. I called it AOVL and MOVL. Reason:
If OVAL is clamped by DRVH/DRVL VAL can continuously change while OVAL
keeps its value. If DRVH or DRVL is written by a calcout record (i.e.)
OVAL can continuously change while VAL is fixed. So there is no hirarchy
of monitor events. For deadband checking I used ADEL and MDEL for OVAL too.
In the Record Manual the field OMOD is explained as follows: "The OMOD
field indicates whether OVAL differs from VAL. It will be different if
VAL or OVAL have changed since the last time the record was processed,
or if VAL has been adjusted by OROC during the current processing." I do
not fully understand the sentence, but in the code you can see, that the
field is allways cleared in monitor(), so after the record has been
processed it is 0. In my modified version the behavior is unchanged for
compatibility.
RVAL and RBV: Checking if they have changed since last processing was
done for them only, when OVAL has changed or if VAL has left its
deadband or if an alam has changed. Then post_event was called if the
check result was TRUE. I think:
1. post_event has to be called even if only the alarm has changed but
the value of RVAL or RBV has not.
2. post_event for RBV must be called if RBV has changed but nothing else
has changed.
I attach here a diff. The original version of aoRecord.c is the
R3.14.11-version with the change of Andrew for the conversion to LONG in
convert implemented. So the line numbers can differ to your release.
Differences are only in monitor().
Bernd
486c486
< unsigned short monitor_mask;
---
> unsigned short alarm_mask, monitor_mask;
489c489
< monitor_mask = recGblResetAlarms(prec);
---
> alarm_mask = monitor_mask = recGblResetAlarms(prec);
514,528c514,558
< if(prec->omod) monitor_mask |= (DBE_VALUE|DBE_LOG);
< if(monitor_mask) {
< prec->omod = FALSE;
< db_post_events(prec,&prec->oval,monitor_mask);
< if(prec->oraw != prec->rval) {
< db_post_events(prec,&prec->rval,
< monitor_mask|DBE_VALUE|DBE_LOG);
< prec->oraw = prec->rval;
< }
< if(prec->orbv != prec->rbv) {
< db_post_events(prec,&prec->rbv,
< monitor_mask|DBE_VALUE|DBE_LOG);
< prec->orbv = prec->rbv;
< }
< }
---
>
> /* check for OVAL change */
> monitor_mask = alarm_mask;
> delta = prec->movl - prec->oval;
> if(delta<0.0) delta = -delta;
> if (delta > prec->mdel) {
> /* post events for OVAL change */
> monitor_mask |= DBE_VALUE;
> /* update last OVAL monitored */
> prec->movl = prec->oval;
> }
> /* check for archive change */
> delta = prec->aovl - prec->oval;
> if(delta<0.0) delta = -delta;
> if (delta > prec->adel) {
> /* post events on value field for archive change */
> monitor_mask |= DBE_LOG;
> /* update last archive value monitored */
> prec->aovl = prec->oval;
> }
>
> /* send out monitors connected to the OVAL field */
> if (monitor_mask){
> db_post_events(prec,&prec->oval,monitor_mask);
> }
>
> monitor_mask = alarm_mask;
> if(prec->omod) {
> prec->omod = FALSE;
> if(prec->oraw != prec->rval) {
> monitor_mask |= (DBE_VALUE|DBE_LOG);
> prec->oraw = prec->rval;
> }
> }
> if (monitor_mask)
> db_post_events(prec,&prec->rval,monitor_mask);
>
> monitor_mask = alarm_mask;
> if(prec->orbv != prec->rbv) {
> monitor_mask |= (DBE_VALUE|DBE_LOG);
> prec->orbv = prec->rbv;
> }
> if (monitor_mask)
> db_post_events(prec,&prec->rbv,monitor_mask);
>
- Replies:
- Re: aoRecord OVAL monitor events Schoeneburg, Bernd
- Navigate by Date:
- Prev:
Re: linker search path (why not -L. ?) Johnson, Andrew N.
- Next:
Re: aoRecord OVAL monitor events Schoeneburg, Bernd
- Index:
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: linker search path (why not -L. ?) Johnson, Andrew N.
- Next:
Re: aoRecord OVAL monitor events Schoeneburg, Bernd
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
<2015>
2016
2017
2018
2019
2020
2021
2022
2023
2024
|