Arithmetic Commands - Mitsubishi Electric MELDAS C6 Programming Manual

Hide thumbs Also See for MELDAS C6:
Table of Contents

Advertisement

13. Program Support Functions

13.5.5 Arithmetic commands

A variety of arithmetic operations can be performed between variables.
Command format
#i = <formula>
<Formula> is a combination of constants, variables, functions and operators.
Constants can be used instead of #j and #k below.
(1)
Definition and
substitution of variables
(2)
Addition arithmetic
(3)
Multiplication arithmetic
(4)
Functions
(Note 1) A value without a decimal point is basically treated as a value with a decimal point at the
(Note 2) Offset amounts from #10001 and work coordinate system offset values from #5201 are
(Note 3) The <formula> after a function must be enclosed in the square parentheses.
#i = #j
#i = #j + #k
#i = #j – #k
#i = #j OR #k
#i = #j XOR #k
#i = #j ∗ #k
#i = #j / #k
#i = #j MOD #k
#i = #j AND #k
#i = SIN [#k]
#i = COS [#k]
#i = TAN [#k]
#i = ATAN [#j]
#i = ACOS [#j]
#i = SQRT [#k]
#i = ABS [#k]
#i = BIN [#k]
#i = BCD [#k]
#i = ROUND [#k] Rounding off
#i = FIX [#k]
#i = FUP [#k]
#i = LN [#k]
#i = EXP [#k]
end (1 = 1.000).
handled as data with a decimal point. Consequently, data with a decimal point will be
produced even when data without a decimal point have been defined in the variable
numbers.
(Example)
#101
= 1000 ;
#10001 = #101 ;
#102
= #10001 ;
13.5 User macro specifications
Definition, substitution
Addition
Subtraction
Logical sum (at every bit of 32 bits)
Exclusive OR (at every bit of 32 bits)
Multiplication
Division
Remainder
Logical product (at every bit of 32 bits)
Sine
Cosine
Tangent (sin/cos used for tan)
Arctangent (ATAN or ATN may be used)
Arc-cosine
Square root (SQRT or SQR may be used)
Absolute value
Conversion from BCD to BIN
Conversion from BIN to BCD
(ROUND or RND may be used)
Discard fractions less than 1
Add for fractions less than 1
Natural logarithm
Exponent with e (=2.718 .....) as bottom
Common variables
after execution
219
#101 1000.000
#102 1000.000

Advertisement

Table of Contents
loading

This manual is also suitable for:

Meldas c64Meldas c64t

Table of Contents