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: Tim Mooney <[email protected]>
To: [email protected]
Date: Tue, 28 Sep 2010 16:43:37 -0500
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

-- Tim Mooney ([email protected]) (630)252-5417 Software Services Group, Advanced Photon Source, Argonne National Lab.


Replies:
Re: CALC expression Maren Purves
Re: CALC expression Matthieu Bec
References:
CALC expression Andrew Wagner

Navigate by Date:
Prev: Re: archiving system John William Sinclair
Next: Re: CALC expression Maren Purves
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 Ralph Lange
Next: Re: CALC expression Maren Purves
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 ·