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  2009  <20102011  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  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: CALC expression
From: Maren Purves <[email protected]>
To: Tim Mooney <[email protected]>
Cc: [email protected]
Date: Tue, 28 Sep 2010 11:51:16 -1000
Tim & Andrew,

but you can to the same thing with 4 calc records that do the
4 fields Tim wrote out below without needing any special
records that somebody/a site may or may not have, no?

Maren

Tim Mooney wrote:
Andrew,

You don't need a subroutine record for this. You might be able to get it into a single calcout
record using techniques folks have already mentioned, but as they've noted, the result might
be hard to understand.


I would do this with a transform record, if the record is available.
You'd have 16 calc-type expressions, each with a comment to describe it, all in one record,
so you could break this into separate expressions and then combine the results.


For example:
    field(CLCF, "235>B && 5>D && 5>E")
    field(CLCG, "B*0.00835-0.7")
    field(CLCH, "A+(C-B)*0.25")
    field(CLCI, "F?(G>H?G:H):0)

Actually, I'd rewrite that last expression as
    field(CLCI, "F?MAX(H,G):0")

This seems to me easier to understand and modify than the equivalent implementation
with calcout records.


Tim

On 9/28/2010 3:03 PM, Andrew Wagner wrote:
(235>B&& 5>D&& 5>E) ? (B*0.00835 - 0.7> A + (C-B)*0.25 ? B*0.00835 - 0.7: A + (C-B)*0.25): 0



References:
CALC expression Andrew Wagner
Re: CALC expression Tim Mooney

Navigate by Date:
Prev: Re: CALC expression Tim Mooney
Next: Re: CALC expression Matthieu Bec
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: CALC expression Tim Mooney
Next: Re: CALC expression Matthieu Bec
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 28 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·