Hi,
To get all information about record I use the "obsolete" following page (that is quite updated anyway ...) : https://wiki-ext.aps.anl.gov/epics/index.php?title=User_Documentation
I haven't found better documentation about it for now:
For your case :
https://epics.anl.gov/base/R7-0/4-docs/calcRecord.html#Expression
CALC can be practical but for limited cases, in your case you can use an "aSub" (C subroutine) or imbricated CALC or also ALARM mechanism (the cleaner way in my opinion).
I think using ALARM you can even get a CALC record without any CALC field expression, something like that, the MS means maximized severity, and your calc will take the upper ALARM level. (MINOR if one of the INP is beyond its limits) (https://docs.epics-controls.org/en/latest/guides/EPICS_Process_Database_Concepts.html)
record(ai, "$(detector)_wib$(crate)0$(wib)/vcc") {
field(HIGH, "5.2")
field(LOW, "4.6")
field(HSV, "MINOR")
field(LSV, "MINOR")
}
Etc ...
record(calc,"$(detector)_wib$(crate)0$(wib)/calc")
{
field(SCAN,"5 second")
field(INPA,"$(detector)_wib$(crate)0$(wib)/vcc MS")
field(INPB,"$(detector)_wib$(crate)0$(wib)/v1 MS")
field(INPC,"$(detector)_wib$(crate)0$(wib)/v2 MS")
field(INPD,"$(detector)_wib$(crate)0$(wib)/v3 MS")
field(INPE,"$(detector)_wib$(crate)0$(wib)/v4 MS")
}
I haven't tested it, but it should work
Cheers
Alexis GAGET
CEA Saclay - DRF/Irfu/DIS/LDISC
-----Message d'origine-----
De : Tech-talk <tech-talk-bounces at aps.anl.gov> De la part de Meddage, Varuna via Tech-talk
Envoyé : mardi 1 novembre 2022 16:08
À : tech-talk at aps.anl.gov
Objet : calc type record question
Hi,
I have following "calc" type record in one of my .db files.
===============================================================
record(calc,"$(detector)_wib$(crate)0$(wib)/calc")
{
field(SCAN,"5 second")
field(CALC,"((A>=4.6&&A<=5.2)&&(B>=4.6&&B<=5.2)&&(C>=1.75&&C<=1.80)&&(D>=3.2&&D<=3.4)&&(E>=0.7&&E<=2.0))?1:0")
field(INPA,"$(detector)_wib$(crate)0$(wib)/vcc")
field(INPB,"$(detector)_wib$(crate)0$(wib)/v1")
field(INPC,"$(detector)_wib$(crate)0$(wib)/v2")
field(INPD,"$(detector)_wib$(crate)0$(wib)/v3")
field(INPE,"$(detector)_wib$(crate)0$(wib)/v4")
field(DESC,"")
field(HIHI,"")
field(HIGH,"")
field(LOW,"")
field(LOLO,"")
field(MDEL,"-1")
field(ADEL,"-1")
field(OOPT,"Every Time")
field(PREC,"6")
}
===============================================================
When I run the EPICS, then I get an error message saying "String is too long" complaining about the expression, I inserted inside the "CALC" field in this record. But when I reduced the number of input PVs of this record from 5 to 4 and rewrite the expression inside "CALC" field, then there is no error.
Is there maximum number of input PVs, that I can use inside a "calc" type record ?
Any help to understand this issue is highly appreciated.
Thanks
Varuna Meddage
- References:
- calc type record question Meddage, Varuna via Tech-talk
- Navigate by Date:
- Prev:
Re: calc type record question Pete Jemian via Tech-talk
- Next:
Re: Re: [EXTERNAL] phoebus display runtime Kasemir, Kay 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:
Re: calc type record question Pete Jemian via Tech-talk
- Next:
ADEiger : master file not found John Dobbins 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
|