EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  <20012002  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  1999  2000  <20012002  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: Apropos making fields configurable
From: Benjamin Franksen <[email protected]>
To: EPICS Techtalk <[email protected]>
Date: Thu, 19 Jul 2001 22:56:53 +0200
Hello everyone,

good news: the changes needed to implement what was proposed for
breakpoint conversion are very simple.

(1) Code in cvtBrk.c need *not* be modified to achieve conversion
without limits. First observation: the limitation is only at the upper
end of the table (i.e. the raw value is greater than the last raw value
in the table), not at the lower end. Second observation: The code is
such that the problem at the upper end is most easily fixed by filling
in the last slope value in the table, instead of keeping it at the
default zero.

Therefore, in base/src/dbStatic/dbLexRoutines.c, function dbBreakBody(),
(reading the breakpoint tables from the dbd file is performed here)
after setting the slopes for all but the last table entries:

    /* Compute slopes */
    for(i=0; i<number-1; i++) {
        ...
    }

add the lines:

    if(number>1)
        pnewbrkTable->papBrkInt[number-1]->slope =
        pnewbrkTable->papBrkInt[number-2]->slope;

and that's it.

(2) Additional field in ao and ai records. I named it BRSV.

BRSV: Severity to apply when out-of-range warnings are returned from
breakpoint conversion functions. These functions return -1 for errors,
and 1 for warnings like value to converted outside table range. If -1
(error) is returned, the behavior is the same as before, i.e.
SOFT_ALARM, INVALID_ALARM. If 1 (out-of-range) is returned, an alarm is
raised only if BRSV is not NO_ALARM. In this case the value of BRSV is
applied for the severity. The default is INVALID_ALARM for maximum
backward compatibility.

Thus the changes in axRecords are: In axRecord.dbd, add

    field(BRSV,DBF_MENU) {
        prompt("Breakpoint Severity")
        promptgroup(GUI_ALARMS)
        pp(TRUE)
        interest(1)
        initial("INVALID")
        menu(menuAlarmSevr)
    }

in axRecord.c, in function convert(), after 

    else { /* must use breakpoint table */

replace lines

        if (cvt...(...)!=0 ) {
            recGblSetSevr(pax,SOFT_ALARM,INVALID_ALARM);
        }

by

        status = cvt...(...);
        if(status == -1) {
            recGblSetSevr(pax,SOFT_ALARM,INVALID_ALARM);
        }
        else if(status && pai->brsv) {
            recGblSetSevr(pax,SOFT_ALARM,pai->brsv);
        }

and add 'long status;' declaration at start of function.

I tested both changes with base R3.13.4.

(3) There is another inconvenience with breakpoint tables, i regularly
stumble over (and which is btw not documented in the developer's guide):
the source values (raw for ai, eng for ao) must be sorted in ascending
order. That's ok as long as the slopes are all positive. Still you have
to remember it, otherwise conversion will give you completely wrong
results.

It becomes very inconvenient if slopes are negative and you want to use
a table in both directions: then you need to provide the same table
twice, once with eng values and once with raw values in ascending order.
I haven't thought of a nice and simple (and efficient!) solution yet.

(3) About the possibility to specify a subroutine name directly into
LINR field, as Rolf Keitel proposed, I think this is a good idea but not
so easily implemented. For the syntax, one could use '()' after the name
to distinguish it from a breakpoint table name. I also have some more
radical solutions in mind, but this is not yet thought through.

Enough of this for today.

Ben


Replies:
Re: Apropos making fields configurable Bob Dalesio
Re: Apropos making fields configurable Marty Kraimer
References:
RE: Apropos making fields configurable Redman, Russell O.

Navigate by Date:
Prev: DDoS Attack - EPICS web-site is down Andrew Johnson
Next: Re: Apropos making fields configurable Bob Dalesio
Index: 1994  1995  1996  1997  1998  1999  2000  <20012002  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: Apropos making fields configurable Redman, Russell O.
Next: Re: Apropos making fields configurable Bob Dalesio
Index: 1994  1995  1996  1997  1998  1999  2000  <20012002  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 ·