Hi Kaz,
I don't know of a more efficient expression for calc or calcout records.
The transform, scalcout, and acalcout records have the operator '@', which would
allow you to replace
field(CALC, "(H=0)?A:(H=1)?B:(H=2)?C:(H=3)?D:(H=4)?E:(H=5)?F:G")
with
field(CALC, "@H")
Tim Mooney ([email protected]) (630)252-5417
Beamline Controls Group (www.aps.anl.gov)
Advanced Photon Source, Argonne National Lab
________________________________________
From: [email protected] [[email protected]] on behalf of Gofron, Kazimierz [[email protected]]
Sent: Tuesday, April 26, 2016 11:04 PM
To: [email protected]
Subject: calc question
Hi,
Perhaps it was discussed previously,
For a current measuring instrument (i404), I am setting measuring range from mbbo record.
record(mbbo, "$(Sys)$(Dev)Cmd:Rng-Sel") {
field(VAL, "1.0e-9")
field(ZRST, "1.0e-9")
field(ONST, "8.0e-9")
field(TWST, "1.0e-8")
field(THST, "1.0e-7")
field(FRST, "1.0e-6")
field(FVST, "1.0e-5")
field(SXST, "2.0e-5")
field(FLNK, "$(Sys)$(Dev)Cmd:Rng-Calc")
field(DESC, "SELECTION OF CURRENT RANGES")
}
record(calc, "$(Sys)$(Dev)Cmd:Rng-Calc") {
field(SCAN, "Passive")
field(A, "1.0e-9")
field(B, "8.0e-9")
field(C, "1.0e-8")
field(D, "1.0e-7")
field(E, "1.0e-6")
field(F, "1.0e-5")
field(G, "2.0e-5")
field(INPH, "$(Sys)$(Dev)Cmd:Rng-Sel")
field(CALC, "(H=0)?A:(H=1)?B:(H=2)?C:(H=3)?D:(H=4)?E:(H=5)?F:G")
field(FLNK, "$(Sys)$(Dev)Val:Rng-SP")
}
record(ao, "$(Sys)$(Dev)Val:Rng-SP") {
field(SCAN, "Passive")
field(FLNK, "$(Sys)$(Dev)Cmd:CapChk-Calcout")
field(OMSL, "closed_loop")
field(OIF, "Full")
field(DOL, "$(Sys)$(Dev)Cmd:Rng-Calc.VAL")
field(EGU, "A")
}
This seems to work quite well, but there has to be a better way than CALC 'switch'. Anyone has a better solution?
Kazimierz
- Replies:
- RE: calc question Gofron, Kazimierz
- References:
- calc question Gofron, Kazimierz
- Navigate by Date:
- Prev:
calc question Gofron, Kazimierz
- Next:
RE: EPICS 3.14.12.3 Build Problems with the new Ubuntu 16.04 LTS Abdalla Ahmad
- 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:
calc question Gofron, Kazimierz
- Next:
RE: calc question Gofron, Kazimierz
- 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
|