Open prjemian opened 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.
The scaler database defines each of these calcs. Here is one example:
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.
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.
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:
These take the form of
$(P)$(S)_calc$(N)
whereP
is the IOC prefix,S
is the scaler PV name (such asscaler1
) andN
is 1 value from 1 .. 8. Each is implemented with thecalc
record from EPICS base.The Enable button is a single
bo
PV with name$(P)$(S)_calcEnable