EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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

Subject: Re: PREC
From: Tim Mooney <[email protected]>
To: "Allison, Stephanie" <[email protected]>
Cc: TECHTALK <[email protected]>
Date: Fri, 11 Jun 2004 14:47:10 -0500
Allison, Stephanie wrote:
>...
> Here is a radical thought - it would be nice to have a new string field (ie,
> .FMT) that specifies how to display the value as a string.  Then I could set
> up the format of our vacuums (ie, VALs that should always be displayed using
> exponential notation) in the database instead of having to override the
> default display format in each client.  Also, some save/restore tools won't
> restore the proper values of things like vacuum limits unless you set a
> ridiculously large PREC.

Well, this might be silly, but if you need flexible format control
on a small scale, you can easily get it from the scalcout record.
Just for fun (well, it seemed fun to me, anyway ... at the time) I
made one use a variable precision and a variable format character:

scalcout.A = "myPV.VAL CP NMS"
scalcout.B = "myPV.PREC CP NMS"
scalcout.AA = "f"   (or other printf format character)
scalcout.CALC = "printf("%."+str(B)[0,'.']+AA,A)"
                             \___________/
                                   |
                             PREC as a string
                            (yuck! "int(B)" should do this)
For
    myPV.VAL == 12.34567
    myPV.PREC == 3
    scalcout.AA == "f"  --> "12.346"
    scalcout.AA == "e"  --> "1.235e+01"
    scalcout.AA == "g"  --> "12.3"


-- Tim Mooney ([email protected]) (630)252-5417 Beamline Controls & Data Acquisition Group Advanced Photon Source, Argonne National Lab


References:
RE: PREC Allison, Stephanie

Navigate by Date:
Prev: RE: Initializing a record VAL field with a constant Allison, Stephanie
Next: Re: RDB connection from IOC [was:] Noboru Yamamoto
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  <20042005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: PREC Allison, Stephanie
Next: RE: PREC Pete R Jemian
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  <20042005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·