Reference Manual
IVC-2D
©
SICK AG • Advanced Industrial Sensors • www.sick.com • All rights reserved
245
Appendix
Appendix
A
Mathematical Expressions
It is possible to create strings that contain mathematical expressions. This is useful for
performing calculations in a program that cannot be performed by the tools.
A mathematical expression always begins with an equal sign (
=
). String parameter values
that begin with an equal sign will be treated as expressions. If a string parameter needs to
begin with an equal sign, preceed it with a single quotation mark, for example
'=Hello
.
When using strings in expressions, the strings must always be enclosed in single quotation
marks, for example
'Hello world'
. If you need to include a single quotation mark in a
string, preceed it with a backslash (
'\'Hello\', she said.'
).
Note:
If fractional values are used in expressions, the decimal delimiter must always be a
dot (.), regardless of any local settings made on the PC. Commas (,) are always used in
expressions for separating parameters.
The following operands are used for referring to table and parameter values:
Operand
Meaning
Vx
Value in table row
x
V(x*n)
Value in table row (
x
*
n
)
S
a
A
b
Argument (input parameter)
b
of Step
a
*
S
a
R
b
Result
b
of step
a
*
*
a
and
b
are arbitrary integers
A.1
Arithmetic Operators
You can use the following operators:
Symbol Meaning
-
Subtraction
+
Addition
*
Multiplication
/
Division
%
Modulo, the remainder from a division of two integers. For
example:
10%3
= 1
^
Power. For example:
2^3
= 8
<
Less than
>
Greater than
Sin(x)
Sine,
x
is the angle in radians
Cos(x)
Cosine,
x
is the angle in radians
Tan(x)
Tangent,
x
is the angle in radians