Experimental Physics and Industrial Control System
> First I'd like to ask if the 'last' fields are usable this way.
They are not. The authoritative list is in postfix.c.
https://github.com/epics-base/epics-base/blob/7.0/modules/libcom/src/calc/postfix.c#L68
> Second, does anyone have a better way of just incrementing a count anytime the inputs change?
> record(calc, "$(P)INC") {
> field(INPA, "$(P)WATCH CP")
> field(CALC, "VAL+1")
> }
Uses a Channel Access list to process '$(P)INC' each time '$(P)WATCH' changes.
This can be extended with additional inputs INPB ...
On 3/19/19 5:42 PM, Neil Hamilton Jr via Tech-talk wrote:
> Hey all,
> I'm trying to create a calc record that looks at previous values to increment a count. See below
> record(calc, "RESULT_A")
> {
> field(SCAN, ".05 second")
> field(INPH, "RESULT_A.LG")
> field(INPA, "RESULTINPA")
> field(INPC, "RESULTINPC")
> field(INPB, "RESULT.LA <http://RESULT.LA>")
> field(INPE, "RESULTINPE")
> field(INPD, "RESULT.LC <http://RESULT.LC>")
> field(INPG, "RESULTINPG")
> field(INPF, "RESULT_A.LE")
> field(CALC, "A#B?1:0+C#D?1:0+E#F?1:0+G#H?1:0")
> }
>
> If I change B to LA in the calc string above I get this error during dbLoadRecords
> RESULT_A.CALC: Syntax error, unknown operator/operand in expression "A#LA?1:0+C#D?1:0+E#F?1:0+G#H?1:0"
>
> First I'd like to ask if the 'last' fields are usable this way. From the record reference manual it appears they are. Second, does anyone have a better way of just incrementing a count anytime the inputs change? Any help is very much appreciated.
>
> Neil Hamilton Jr
- Replies:
- Re: R3.15.6 calc string doesn't accept LA, LB, LC, etc...? Michael Davidsaver via Tech-talk
- References:
- R3.15.6 calc string doesn't accept LA, LB, LC, etc...? Neil Hamilton Jr via Tech-talk
- Navigate by Date:
- Prev:
R3.15.6 calc string doesn't accept LA, LB, LC, etc...? Neil Hamilton Jr via Tech-talk
- Next:
Re: R3.15.6 calc string doesn't accept LA, LB, LC, etc...? Michael Davidsaver via Tech-talk
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
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:
R3.15.6 calc string doesn't accept LA, LB, LC, etc...? Neil Hamilton Jr via Tech-talk
- Next:
Re: R3.15.6 calc string doesn't accept LA, LB, LC, etc...? Michael Davidsaver via Tech-talk
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
<2019>
2020
2021
2022
2023
2024