5238-E P-6SECTION 1 PROGRAM CONFIGURATIONS5. Mathematical Operation FunctionsMathematical operation functions are used to convey logical operations, arithmetic operations, andtrigonometric functions. A table of the operation symbols is shown below. Operation functions canbe used together with variables to control peripherals or to pass on the results of an operation.Category Operation Operator RemarksLogicaloperationExclusive OR EOR 0110 = 1010 EOR 1100 (See *3.)Logical OR OR 1110 = 1010 OR 1100Logical AND AND 1000 = 1010 AND 1100Negation NOT 1010 = NOT 0101ArithmeticoperationAddition + 8 = 5 + 3Subtraction - 2 = 5 - 3Multiplication * 15 = 5 * 3Division / (slash) 3 = 15/5Trigonometricfunctions, 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]BracketsOpening bracket [ Determines the priority of an operation.(Operations inside the bracket areperformed first.)Closing bracket ]*1. The value of ATAN2 [b, a] is an argument (range: -180 to 180) of the point that is expressedby 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 inbrackets "[ ]". ( "a", "b", and "c" are used to indicate the contents of the corresponding bits.)