I2773-4.4 en
131
Somat eDAQ
lite
Desk Calculator Expression
Build the Desk Calculator expression using keyboard entry or by double clicking an
input channel or operation to add it to the expression. Syntax for the Desk Calculator
expression is modeled after the standard C programming language and follows the
same operator precedence rules. All operators and referenced input channels are
case sensitive. Operand data type consistency is strictly enforced in the parsing of the
Desk Calculator expression operators. TCE warns of any syntax errors it detects after
clicking OK.
Floating point exceptions can occur with the misuse of certain Desk Calculator
operators such as taking the square root or logarithm of a negative number. When
detecting these exceptions, the eDAQ
lite
sets the MathException status flag. The
results of such operations are usually some form of IEEE NAN (not a number).
Category Operator Syntax Return
Arithmetic abs abs(
a
) The absolute value of
a
.
sqrt sqrt(
a
) The square root of
a
.
log log(
a
) The natural logarithm of
a
.
log10 log10(
a
) The base-10 logarithm of
a
.
exp exp(
a
) The exponential function of
a
.
sgn sgn(
a
)-1 for
a
< 0, 1 for
a
> 0 and 0 for a = 0.
float float(
a
)
a
in floating point data type.
round round(
a
) The nearest integer to
a
.
floor floor(
a
) The largest integer less than
a
.
ceil ceil(
a
) The smallest integer greater than
a
.
^
a
^
ba
raised to the power of
b
.
*
a
*
b
The product of
a
and
b
.
/
a
/
b
The quotient of
a
and
b
.
%
a
%
b
The modulus of
a
and
b
.
+
a
+
b
The sum of
a
and
b
.
-
a
-
b
The difference of
a
and
b
.
Trigonometric
(all angles in radians)
sin sin(
a
) The sine of
a
.
cos cos(
a
) The cosine of
a
.
tan tan(
a
) The tangent of
a
.
asin asin(
a
) The arcsine of
a
in the range [-PI/2, PI/2].
acos acos(
a
) The arccosine of
a
in the range [0, PI].
atan atan(
a
) The arctangent of
a
in the range [-PI/2, PI/2].
HBM: public