CALC1 -*- shell-script -*- # Example definition file for the CALC ProcessVariable # # First line "CALC1 ..." is magic and provides version number # as well as EMACS mode with is not necessary # but makes for - by definition - cool coloring # when this file is edited in emacs. # For now this file has to be called "calc.list" # and has to be # a) in the current directory # b) accessible as $EDMFILES/calc.list # # Suggestions are welcome regarding how EDM should # locate and load additional calculation definitions. # # Empty lines and comments like these, # beginning with '#', are ignored. # # Syntax for the rest of the file: # # # # # The name is used to refer to a CALC PV aa "CALC\name" # or "CALC\name(argA, argB, argC, ...). # # Implementation is in EPICS CALC record syntax, # with A, B, C, ... being variable names for the arguments. # # Usage Examples: # # "CALC\sum(fred, jane)" # executes the definition of "sum" with # A = value of fred # B = value of jane # whenever either PV changes. # The time stamp of the result is the most recent of the PVs'. # If no time stamp is available from any of the arguments, # the current host time is used. # # Status/severity are maximized, # i.e. if fred is in ??/MINOR and jane in READ/INVALID, # the result will be READ/INVALID. # # The remaining PV properties (display limits, ...) # are currently undefined for a CALC PV, # the plan is to add configuration parameters # that will become part of this file. # # Note: arguments are not checked! # If e.g. CALC\sum(a,b) requires two arguments, # nonone cares if you provide 0, 2 or 5 arguments instead of 2. # See the random example below on why this is a feature. # # kasemir@lanl.gov # Example: CALC\sum(x, y) will summarize the arguments sum # Implementation: A+B # Example: CALC\F2C(t) # transforms given Fahrenheit-Temperature into much more # meaningful Deg. C F2C # Implementation: (A-32)*5/9 # Formula to create random number. # This one does not need arguments. # With no PV input, this one will never update! # Possible circumvention: Provide a PV just to # trigger recalculation, e.g. use # "CALC\random(some_1Hz_PV)" # to see changes at ~1Hz. random # Implementation: RNDM