Experimental Physics and
| |||||||||||||||
|
we all know the PREC field of many records. Unforunately, its purpose is not documented very precisely. The Application Developer's Guide says in chapter 3.5.1 (EPICS Overview - Channel Access - Client Services): "In addition to requesting process variable values, any combination of the following additional information may be requested: [...] * Precision: Precision with which to display floating point numbers." In the Record Reference Manual, one can read e.g. in the ai chapter: "The PREC field determines the floating point precision with which to display VAL." But what does this exactly mean? I think, the most intuitive sense is to format the value like "%.<PREC>f". At least this is the default behaviour of medm when using a text monitor. But why not like "%.<PREC>g" or "%.<PREC>e"? And why does neither caget nor camonitor honor PREC? And what about negative PREC values? I suggest the following: PREC >= 0 means to format the value like printf("%.*f",PREC,VAL); PREC < 0 means to format the value like printf("%.*e",-PREC,VAL); All tools including caget and camonitor should honor PREC. Any comments? Dirk -- Dr. Dirk Zimoch Swiss Light Source Paul Scherrer Institut Computing and Controls phone +41 56 310 5182 fax +41 56 310 4413
| ||||||||||||||
ANJ, 10 Aug 2010 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |