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  <20212022  2023  2024  2025  2026  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  <20212022  2023  2024  2025  2026 
<== Date ==> <== Thread ==>

Subject: RE: changing unit string to scale factor
From: Mark Rivers via Tech-talk <[email protected]>
To: 'Randall Cayford' <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Mon, 25 Jan 2021 20:27:06 +0000
Look at the scalcout record:

http://htmlpreview.github.io/?https://github.com/epics-modules/calc/blob/master/documentation/sCalcoutRecord.html

Mark


-----Original Message-----
From: Tech-talk <[email protected]> On Behalf Of Randall Cayford via Tech-talk
Sent: Monday, January 25, 2021 2:16 PM
To: Engbretson, Mark S. via Tech-talk <[email protected]>
Subject: changing unit string to scale factor

I have a device which returns a value and a string indicating the units of the value.  I’ll get inputs like 0.3nA or 3.4mA, etc.  Since I want to report the value in a consistent unit, I want to convert the unit string to a scale factor (nA=1, uA=1000, mA=10000) and then use a calc record to scale the value.   CALC records seem to only take numbers as input and I don’t see any other appropriate record type.

In programming I would use a case statement or if-elseif constructs.  How do I do this with EPICS record processing?

Randall
LBNL


References:
changing unit string to scale factor Randall Cayford via Tech-talk

Navigate by Date:
Prev: Re: Channel connection performance Michael Davidsaver via Tech-talk
Next: RE: changing unit string to scale factor Mark Rivers 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  <20212022  2023  2024  2025  2026 
Navigate by Thread:
Prev: changing unit string to scale factor Randall Cayford via Tech-talk
Next: RE: changing unit string to scale factor Mark Rivers 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  <20212022  2023  2024  2025  2026 
ANJ, 19 Mar 2026 · Home · News · About · Talk · Base · Modules · Extensions ·
· Distributions · Download · Documents · Links · Licensing ·