Download Print this page

Danfoss MCO 305 Design Manual page 87

Hide thumbs Also See for MCO 305:

Advertisement

MCO 305 Design Guide
Inform yourself about the type of assignment operation which is structured in accordance with the Bit/Byte
commands and about the priorities of the operators and the operations.
NB!:
All arithmetical operations are integer number operations.
Operators
Symbol
Meaning
+
plus
minus
*
times
%
divided by
^
XOR
mod
Modulo
rnd
Division
abs
Absolute
amount
Bit Operators
Symbol
Meaning
&
and
or
invert
<<
left shift
>>
right shift
.
Bit
.b
Byte
.w
Word
.l
Long
__ How to Program __
Syntax / Example
3 + 3
= 6
9 – 3
= 6
2 * 3
= 6
19 % 3
= 6
expr1 ^ expr2
127 ^ 255 = 128
expr1 mod expr2
250 mod 16 = 10
expr1 rnd expr2
250 rnd 16 = 16
Abs(expr)
abs (-5) = 5
Syntax / Example
7 & 6
= 6
2 | 4
= 6
(–7)
= 6
3 << 1
= 6
12 >> 1
= 6
expr1.expr2
7.1 = 1
7.3 = 1
7.4 = 0
expr1.b expr2
0x027F.b1 = 127
0x027F.b2 = 2
expr1.w expr2
0x0010FFFF.w2 = 16
expr1.l expr2
®
MG.33.L4.02 – VLT
is a registered Danfoss trademark
Description
Addition
Subtraction
Multiplication
Division (result is truncated)
Exclusive Or (binary operation)
Mathematic modulo (rest of an integer division)
Division with round-off (opposite to truncating)
Absolute amount of the expression
Description
bit-by-bit relationship
bit-by-bit relationship
bit-by-bit inversion
bit-by-bit shift to the left
bit-by-bit shift to the right
Returns the Bit expr2 from expr1
Returns the Byte expr2 from expr1
Returns the Word expr2 from expr1
Returns the Long expr2 from expr1
(standard)
Value range
1 - 32
1 - 4
1 - 2
87

Advertisement

loading