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  2016  2017  2018  2019  2020  2021  2022  <20232024  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  <20232024 
<== Date ==> <== Thread ==>

Subject: Re: Scaling mA to A: EPICS or Phoebus?
From: Michael Davidsaver via Tech-talk <tech-talk at aps.anl.gov>
To: "Leblanc, Gregory" <leblanc at ohio.edu>
Cc: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Fri, 23 Jun 2023 11:17:21 -0700
I would suggest looking into the ALSO/AOFF fields of ai/ao.

The most direct way to explain their usage is to quote the code in streamDevice:

            if (ai->aslo != 0.0 && ai->aslo != 1.0) val *= ai->aslo;
            val += ai->aoff;

https://github.com/paulscherrerinstitute/StreamDevice/blob/a9e0fb7beb74ed0868995934085b5c7e412ce84c/src/devaiStream.c#L38

            if (ao->aslo != 0.0 && ao->aslo != 1.0) val *= ao->aslo;
            ao->val = val + ao->aoff;

https://github.com/paulscherrerinstitute/StreamDevice/blob/a9e0fb7beb74ed0868995934085b5c7e412ce84c/src/devaoStream.c#L36-L37


On 6/23/23 09:19, Leblanc, Gregory via Tech-talk wrote:
Hi folks!

I'm trying to get a basic control implemented for our new Heinzinger PCU 50-300 supplies.  These supplies operate best using RS-422, and I've got EPICS talking to a Keysight 4-port USB to RS-422 adapter.  I'm going to skip over the .proto file, since it seems to be working (I'll try to get something uploaded somewhere once I finish testing).  I've got a .db file with the following two entries:

record(ai, "$(P)$(R)GetCurrent") {
     field(DESC, "Read output current")
     field(DTYP, "stream")
     field(INP, "@devPCU50_300.proto getCurrent $(PORT) $(A)")
     field(EGU, "mA")
     field(SCAN, "1 second")
     # field(SCAN, "Passive")
     field(PINI, "YES")
}

record(ao, "$(P)$(R)SetCurrent") {
     field(DESC, "Write output current")
     field(DTYP, "stream")
     field(EGU, "mA")
     # field(SCAN, "1 second")
     field(SCAN, "Passive")
     field(OUT, "@devPCU50_300.proto setCurrent(%d) $(PORT) $(A)")
     field(PINI, "YES")
     field(VAL, "0")
     field(FLNK, "$(P)$(R)GetCurrent")
}

These power supplies expect commands in mA, and return results in mA, so I made my Phoebus display (bob file and screenshot attached) using mA, and it works OK.  But given that these supplies have an output current of 300A, 300,000 mA looks silly and is hard to read.  Is there a preferred method of tackling this problem?  Since there are "hints" as to the units in the records, it seems like someone has probably run into this before, but I didn't find anything when I searched.  Any advice greatly appreciated!
      Greg

--
Gregory Leblanc
Accelerator Engineer
Edwards Accelerator Lab - Ohio University
123 University Terrace
Athens, OH 45701 USA
leblanc at ohio.edu
M: (401) 52-OUAL1 or (401) 526-8251



References:
Scaling mA to A: EPICS or Phoebus? Leblanc, Gregory via Tech-talk

Navigate by Date:
Prev: Scaling mA to A: EPICS or Phoebus? Leblanc, Gregory via Tech-talk
Next: Real-Time Spectral Analysis of streaming data in EPICS operator screens. Evans, Richard K. (GRC-H000) 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  <20232024 
Navigate by Thread:
Prev: Scaling mA to A: EPICS or Phoebus? Leblanc, Gregory via Tech-talk
Next: RE: [External] Re: Scaling mA to A: EPICS or Phoebus? Leblanc, Gregory 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  <20232024 
ANJ, 23 Jun 2023 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·