Programmable SyncPos motion controller
MG.10.J8.02 – VLT is a registered Danfoss trade mark
94
Programming with SyncPos
Operators
Symbol
Meaning
Syntax / Example
Description
+
plus
3 + 3 = 6
Addition
–
minus
9 – 3= 6
Subtraction
*
times
2 * 3 = 6
Multiplication
%
divided by
19 % 3 = 6
Division (result is truncated)
^
X O R
expr1 ^ expr2
Exclusive Or (binary operation)
127 ^ 255 = 128
mod
modulo
expr1 mod expr2
Mathematic modulo (rest of an integer division)
250 mod 16 = 10
rnd
division
expr1 rnd expr2
Division with round-off (opposite to truncating)
250 rnd 16 = 16
abs
absolute amount Abs(expr)
Absolute amount of the expression
abs (-5) = 5
Bit operators
Symbol
Meaning
Syntax / Example
Description
&
and
7 & 6 = 6
bit-by-bit relationship
|
or
2 | 4 = 6
bit-by-bit relationship
~
invert
~(–7) = 6
bit-by-bit inversion
<<
left shift
3 << 1 = 6
bit-by-bit shift to the left
>>
right shift
12 >> 1 = 6
bit-by-bit shift to the right
.
B i t
expr1.expr2
Returns the Bit expr2 from expr1
7.1 = 1
7.3 = 1
7.4 = 0
. b
Byte
expr1.b expr2
Returns the Byte expr2 from expr1
0x027F.b1 = 127
0x027F.b2 = 2
.w
Word
expr1.w expr2
Returns the Word expr2 from expr1
0x0010FFFF.w2 = 16
.l
Long
expr1.l expr2
Returns the Long expr2 from expr1 (standard)
Comparison Operations and Logical Operations
Comparison operations
>
greater than
<
less than
>
=
greater than or equal to
<
=
less than or equal to
==
the same as
!=
not equal
Logical operations
AN D
and
O R
or
NOT
not