![Okuma OSP-P200L Programming Manual Download Page 19](http://html1.mh-extra.com/html/okuma/osp-p200l/osp-p200l_programming-manual_3667818019.webp)
5238-E P-6
SECTION 1 PROGRAM CONFIGURATIONS
5.
Mathematical Operation Functions
Mathematical operation functions are used to convey logical operations, arithmetic operations, and
trigonometric functions. A table of the operation symbols is shown below. Operation functions can
be used together with variables to control peripherals or to pass on the results of an operation.
Category
Operation
Operator
Remarks
Logical
operation
Exclusive OR
EOR
0110 = 1010 EOR 1100 (See *3.)
Logical OR
OR
1110 = 1010 OR 1100
Logical AND
AND
1000 = 1010 AND 1100
Negation
NOT
1010 = NOT 0101
Arithmetic
operation
Addition
+
8 = 5 + 3
Subtraction
-
2 = 5 - 3
Multiplication
*
15 = 5 * 3
Division
/ (slash)
3 = 15/5
Trigonometric
functions, etc.
Sine
SIN
0.5 = SIN [30] (See *4.)
Cosine
COS
0.5 = COS [60]
Tangent
TAN
1 = TAN [45]
Arctangent (1)
ATAN
45 = ATAN [1] (value range: -90 to 90)
Arctangent (2)
ATAN2
30 = ATAN 2 [1,(Square root 3)] (See
*1.)
Square root
SQRT
4 = SQRT [16]
Absolute value
ABS
3 = ABS [-3]
Decimal to binary conversion
BIN
25 = BIN [$25]
($ represents a hexadecimal number.)
Binary to decimal conversion
BCD
$25 = BCD [25]
Integer implementation (rounding)
ROUND
128 = ROUND [1.2763 x 102]
Integer implementation (truncation)
FIX
127 = FIX [1.2763 x 102]
Integer implementation (raising)
FUP
128 = FUP [1.2763 x 102]
Unit integer implementation
(rounding)
DROUND
13.265 = DROUND [13.26462] (See
*2.)
Unit integer implementation
(truncation)
DFlX
13.264 = DFlX [13.26462] (See *2.)
Unit integer implementation (raising) DFUP
13.265 = DFUP [13.26462] (See *2.)
Remainder
MOD
2 = MOD [17, 5]
Brackets
Opening bracket
[
Determines the priority of an operation.
(Operations inside the bracket are
performed first.)
Closing bracket
]
*1. The value of ATAN2 [b, a] is an argument (range: -180 to 180) of the point that is expressed
by coordinate values (a, b).
*2. In this example, the setting unit is mm.
*3. Blanks must be placed before and after the logical operation symbols (EOR, OR, AND, NOT).
*4. Numbers after function operation symbols (SIN, COS, TAN, etc.) must be enclosed in
brackets "[ ]". ( "a", "b", and "c" are used to indicate the contents of the corresponding bits.)