Math Functions
Arithmetic Functions
Expressions support many standard arithmetic functions:
abs(x): Compute absolute value of a numberceil(x): Round value up to next integerfloor(x): Round a value down to next integerlog(x, base): Calculate the logarithm of a valueround(x, n): Round to the nearest integer or n decimal placessqrt(x): Calculate the square root of a value
Examples:
floor(AIN0)
round(abs(spindle-speed))
Statistics Functions
Expressions support several statistical functions. These functions can consume an arbitrary number of arguments, including variables, data sources, or constants.
max(a, b, ...): Compute the maximum value of the passed valuesmean(a, b, ...): Compute the mean value of the passed valuesmedian(a, b, ...): Compute the median value of the passed valuesmin(a, b, ...): Compute the minimum value of the passed valuesmode(a, b, ...): Compute the mode of the passed valuesprod(a, b, ...): Compute the product of the passed valuesstd(a, b, ...): Compute the standard deviation of the passed valuessum(a, b, ...): Compute the sum of the passed valuesvariance(a, b, ...): Compute the variance of the passed values
Examples:
max(spindle-1, spindle-2, spindle-3) > 6000
Trig Functions
Expressions support several trigonometry functions.
acos(x): Calculate the inverse cosine of a valueacot(x): Calculate the inverse cotangent of a valueacsc(x): Calculate the inverse cosecant of a valueasec(x): Calculate the inverse secant of a valueasin(x): Calculate the inverse sine of a valueatan(x): Calculate the inverse tangent of a valuecos(x): Calculate the cosine of a valuecot(x): Calculate the cotangent of a valuecsc(x): Calculate the cosecant of a valuesec(x): Calculate the secant of a valuesin(x): Calculate the sine of a valuetan(x): Calculate the tangent of a value