Usage : MACALC is the Java Open Access Client (OAC) process which supports user-defined calculated devices whose values are derived from the readings of other devices. Devices are defined by the use of a web-based expression editor (http://belobog.fnal.gov:8000/CompositeDevices/index.jsp?). Use of this editor requires an account which can be requested from Timofei Bolshakov. MACALC device readings are updated at a 1 Hz rate. You can view log files for MACALC in the directory 'daesrv\\engines\files\oac'. MACALC runs on DUE39. MACALC's defining expression really looks like an equation. You enter an algebraic expression, using ACNET device names as the variables. Several mathematical functions including those in the Java Math class (e.g. sin, cos, tan, sqrt, ceil, abs, exp, log,...) and others including cosh, sinh, tanh, min, max, average, sum, and condif are all implemented. Some examples: * (D:95WST + D:95WRT)/2 * 0.463 * ( A_FLOWPC - A_FUPPC ) (We have adopted the convention in use in other places that specifying the device name using an underscore (_) in place of a colon means read the setting.) * condif((A:T109SM @ 0.0), (10000.0*A:IBMAV/A:T109SM),0.0) condif is a conditional function. If the first argument is true, it returns the second argument, otherwise the third. condif(boolean condition, value1, value2) is the equivalent of the C/Java notation "(boolean condition)?value1:value2;". Instead of '>' we use '@' because '>' is otherwise used for array notation. A single verticle bar '|' is used as the binary OR. A single ampersand '&' is used as the binary AND. * condif((((a:ibeam @ -200.0) & (a:ibeam< -0.05)) |((a:ibeam @ 0.05) &(a:ibeam < 200.0))),A:EMITH/a:ibeam,0.0) If an MACALC device has a status property, it's expression must only contain logical arithmetic operations. Only the following logical functions are available: rightShftBytes(device,Nbytes), leftShftBytes(device,Nbytes), logicalOr(A,B),logicalAnd(A,B), logicalXOR(A,B), and byteNumber(device,N). * logicalOr(I:LCWCUB:0:1,leftShiftBytes(I:LCWCUB:10:2,1)) Restart: MACALC is restarted when its DAE is restarted.
Keeper: Dennis Nicklaus
OAC Node: dce10
Now: Mon Oct 6 22:12:00 2008