> Try to simplify your _expression_,
and use spare INP fields to hold constants ... C>=1.75&&C =>
C>=F&&C (INPF=1.75)
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Kasemir, Kay via Tech-talk <tech-talk at aps.anl.gov>
Sent: Tuesday, November 1, 2022 11:13 AM
To: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>; Meddage, Varuna <meddage at phys.ksu.edu>
Subject: Re: calc type record question
The length of the CALC field is limited something around 80 characters.
Try to simplify your _expression_, for example by removing some parentheses that are good for readability but not strictly necessary.
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Meddage, Varuna via Tech-talk <tech-talk at aps.anl.gov>
Sent: Tuesday, November 1, 2022 11:08 AM
To: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: [EXTERNAL] 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
|