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
<2010>
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
- 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
<2010>
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
|