EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: calc question
From: "Gofron, Kazimierz" <[email protected]>
To: "'Mooney, Tim M.'" <[email protected]>, "[email protected]" <[email protected]>
Date: Thu, 28 Apr 2016 20:58:45 +0000
Hello Tim,

Good to know field(CALC, "@H") switch for transform, scalcout, and acalcout records.

Kaz

-----Original Message-----
From: Mooney, Tim M. [mailto:[email protected]] 
Sent: Wednesday, April 27, 2016 1:33 AM
To: Gofron, Kazimierz; [email protected]
Subject: RE: calc question

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


References:
calc question Gofron, Kazimierz
RE: calc question Mooney, Tim M.

Navigate by Date:
Prev: RE: stream Device I/O error Gofron, Kazimierz
Next: LinMot Motor Controllers bob dalesio
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: calc question Mooney, Tim M.
Next: caget always not found l123173
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 15 Jul 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·