
B-63944EN/02 PROGRAMMING 17.REAL-TIME CUSTOM MACRO
- 507 -
17.3 ARITHMETIC AND LOGICAL OPERATION
With the real time custom macros, the following arithmetic and logical
operations can be specified:
Table 1.3 Arithmetic and logical operation
Type of operation Operation Description
(1) Definition, substitution #i=#j Definition or substitution of a variable
(2) Additive operation #i=#j+#k
#i=#j-#k
#i=#j OR #k
#i=#j XOR #k
Addition
Subtraction
Logical OR (Bit by bit for 32 bits)
Exclusive OR (Bit by bit for 32 bits)
(3) Multiplicative operation #i=#j*#k
#i=#j/#k
#i=#j AND #k
#i=#j MOD #k
Multiplication
Division
Logical AND (Bit by bit for 32 bits)
Remainder (#j and #k are rounded to an integer to
find a remainder. When #j is negative, #i is also
negative.)
(4) Function #i=SIN[#j]
#i=COS[#j]
#i=TAN[#j]
#i=ASIN[#j]
#i=ACOS[#j]
#i=ATAN[#j]
#i=ATAN[#j]/[#k]
#i=ATAN[#j,#k]
#i=SQRT[#j]
#i=ABS[#j]
#i=BIN[#j]
#i=BCD[#j]
#i=ROUND[#j]
#i=FIX[#j]
#i=FUP[#j]
#i=LN[#j]
#i=EXP[#j]
#i=POW[#j,#k]
Sine (in deg)
Cosine (in deg)
Tangent (in deg)
Arcsine
Arccosine
Arctangent (1 argument). ATN is acceptable.
Arctangent (2 arguments). ATN is acceptable.
Ditto
Square root. SQR is acceptable.
Absolute value
Binary conversion from BCD
BCD conversion from binary
Rounding. RND is acceptable.
Discarding fractional digits
Rounding fractional digits upward to an integer
Natural logarithm
Exponent with e (2.718……) used as the base
Power (#j to #k power)
- Constant specifiable in <expression>
+0.00000000001 to +999999999999
-999999999999 to -0.00000000001
Up to 12 decimal digits can be specified.
If the maximum allowable number of digits is exceeded, P/S0012
alarm is issued.