Experimental Physics and
| |||||||||||||||
|
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.
For instance, using the "motor" record, the MRES field has the distance (in EGU) that the motor takes with each integer step pulse. Users always want the motor VAL and RBV fields to be displayed in a %f format. BUT, MRES can have significant figures which, by its very definition, extend well past what a PREC field will show. If the PREC field is used to format an archive of the MRES field with a %f format specifier, such as with caGet and camonitor, there will be a loss of precision due to truncation. With the motor record, there is a work around for this, store the SREV and UREV fields, which are used to compute MRES. UREV can be represented with the standard format and SREV is an integer. (MRES = UREV / SREV) See this short example to illustrate this situation: jemian,3$ camonitor iad:m58:c0:m1.{MRES,SREV,UREV} iad:m58:c0:m1.MRES 06/11/04 12:59:58.405796463 0.00000 iad:m58:c0:m1.SREV 06/11/04 12:59:58.405796463 50800 iad:m58:c0:m1.UREV 06/11/04 12:59:58.405796463 0.13022 jemian,4$ caget iad:m58:c0:m1.MRES iad:m58:c0:m1.MRES 2.56339e-06 jemian,5$ caget iad:m58:c0:m1.SREV iad:m58:c0:m1.SREV 50800 jemian,6$ caget iad:m58:c0:m1.UREV iad:m58:c0:m1.UREV 0.13022 jemian,7$ caget iad:m58:c0:m1.PREC iad:m58:c0:m1.PREC 5 jemian,8$ caget iad:m58:c0:m1.VAL iad:m58:c0:m1.VAL 10.7464 jemian,9$ caget iad:m58:c0:m1.RBV iad:m58:c0:m1.RBV 10.7464 jemian,10$ echo iad:m58:c0:m1.{MRES,SREV,UREV,PREC,VAL,RBV}\\n | caGet iad:m58:c0:m1.MRES 0.00000 iad:m58:c0:m1.SREV 50800 iad:m58:c0:m1.UREV 0.13022 iad:m58:c0:m1.PREC 5 iad:m58:c0:m1.VAL 10.74640 iad:m58:c0:m1.RBV 10.74640 *** caGet completed normally *** Pete Jemian
| ||||||||||||||
ANJ, 10 Aug 2010 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |