bluesky / ophyd

hardware abstraction in Python with an emphasis on EPICS
https://blueskyproject.io/ophyd
BSD 3-Clause "New" or "Revised" License
48 stars 77 forks source link

ScalerCH should support the additional User calculations #982

Open prjemian opened 3 years ago

prjemian commented 3 years ago

In the synApps scaler support, the database provides additional User calculations that enable preliminary processing within the IOC database, supporting common operations such as $I/I_0$ or $\ln(I_0/I)$. See this control screen:

Clipboard01

These take the form of $(P)$(S)_calc$(N) where P is the IOC prefix, S is the scaler PV name (such as scaler1) and N is 1 value from 1 .. 8. Each is implemented with the calc record from EPICS base.

The Enable button is a single bo PV with name $(P)$(S)_calcEnable

prjemian commented 3 years ago

These User calculations are not ties to any specific channel. They should be considered as additional data to be recorded if the calculation is not empty.

prjemian commented 3 years ago

The scaler database defines each of these calcs. Here is one example:

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

It is only necessary to support the .CALC and .VAL fields as these are the only fields exposed in the GUI screens. The .PREC field is interesting since it controls displayed precision. The .DESC is not shown in the graphical screens so it cannot be relied upon to contain text useful in describing the calculation or to name it.

prjemian commented 3 years ago

Note there are alternative scaler databases (example) that use the transform record instead of the calc record. This results in a different set of fields to be supported. Yikes! Not sure the alternative databases are so popular but we need to be prepared for a variant.