EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 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: VAL keyword in calcout records
From: Andrew Johnson <[email protected]>
To: [email protected]
Date: Mon, 12 Apr 2010 17:43:51 -0500
On Monday 12 April 2010 17:12:45 Ralph Lange wrote:
>
> I just learned that the recently introduced VAL keyword does not
> (quoting the Record Reference Manual) return "the current contents of
> the VAL field" but rather "the current contents of this expression's
> result".

That sentence was obviously written assuming that the result would be assigned 
to the VAL field, which was always true for the Calc record but not for the 
Calcout.  The VAL keyword could be added because calcPerform() takes a pointer 
to the double where it should put the result, so it assumes that the previous 
value is still available.

> Which means, that inside a calcout record's OCAL expression, VAL refers
> to OVAL, not VAL.
> Which means you can not use VAL inside OCAL to refer to the result of
> the CALC expression, but have to repeat the CALC expression inside OCAL
> to get the same value.
>
> Which (in my case) makes the OCAL expression more than 40 characters
> long, which doesn't work.

If you have a spare input and enough space in the CALC expression you could 
assign the CALC result to that variable using the := operator, then it will be 
available to use in your OCAL expression:

CALC: L:=<expression>;L
OCAL: <expression using L>

> Should we change the behaviour or the documentation?

My first though was that we have to change the documentation of the Calcout 
record, but I guess it would be possible to assign prec->oval = prec->val 
before evaluating OCAL.  However if someone does understand how the VAL 
keyword works they might already be relying on the existing behaviour.

I think I'd be happier just fixing the documentation.

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


References:
VAL keyword in calcout records Ralph Lange

Navigate by Date:
Prev: VAL keyword in calcout records Ralph Lange
Next: 64-bit Windows architecture support in EPICS Mark Rivers
Index: 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: VAL keyword in calcout records Ralph Lange
Next: 64-bit Windows architecture support in EPICS Mark Rivers
Index: 2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Feb 2012 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·