ETEL Doc. - Operation & Software Manual # DSC2P 903 / Ver. F / 3/6/05
Chapter D: Programming
Operation & Software Manual
Direct Drives & Systems
227
14.5 Mathematical operations
The mathematical operations which can be applied to
registers are divided into two groups: arithmetical operations
and logical operations. The symbols used for each operation
are displayed in this table.
Mathematical operations can be realized only with 3 types of
registers: K parameters, F floats and X variables.
for additional mathematical operations with F
registers.
14.5.1 Arithmetical operations
All operations are performed by using integer numbers. Hence, additions, subtractions and multiplications give
exact answers, whereas fractional parts are lost with the division.
Examples:
In these examples, what is called result is the value memorized in X1.1 after executing the command. The value
at the start of X1.1 is 23 in any case.
14.5.2 Logical operations
Logical operations allow the user to directly work on the bits which compose the register value. The controller
does not accept the values in binary writing, and the user will consequently have to do the conversions himself.
Here is the Boolean operation tables for logical operations:
Initial value
Operation
Result
X1.1=23
X1.1+=7
30
X1.1+=-3
20
X1.1-=5
18
X1.1*=2
46
X1.1/=7
3 (integer of 3.2857)
Basic values
Result
A
B
¬A
A
∧
B
A v B
A
∧
(¬B)
A v (¬B)
~ A
A & B
A I B
A & ~ B
A I ~ B
0
0
1
0
0
0
1
0
1
1
0
1
0
0
1
0
0
0
1
1
1
1
1
0
1
1
0
1
Symbol
Operation
Arithmetical operations
+
-
*
/
Addition
Subtraction
Multiplication
Division
Logical operations
~
&
I
&~
I~
>>
<<
Not
And
Or
«Not» and «and»
«Not» and «or»
Shift to the right
Shift to the left
Содержание DSC Series
Страница 2: ...THIS PAGE IS INTENTIONALLY LEFT BLANK ...