
PROGRAMMING
B–61404E/08
15. CUSTOM MACRO A
292
Table 15.2.3
G code H code Function Definition
G65 H01 Definition, substitution #i = #j
G65 H02 Addition #i = #j + #k
G65 H03 Subtraction #i = #j – #k
G65 H04 Product #i = #j #k
G65 H05 Division #i = #jB #k
G65 H11 Logical sum #i = #j. OR. #k
G65 H12 Logical product #i = #j. AND. #k
G65 H13 Exclusive OR #i = #j. XOR. #k
G65 H21 Square root
#i + #j
Ǹ
G65 H22 Absolute value #i = | #j |
G65 H23 Remainder #i = #j – trunc (#j / #k) #k
(trunc : Discard fractions less than 1)
G65 H24 Conversion from BCD to binary #i = BIN (#j)
G65 H25 Conversion from binary to BCD #i = BCD (#j)
G65 H26 Combined multiplication/division #i = (#i #j)B #k
G65 H27 Combined square root 1
#i + #J
2
) #K
2
Ǹ
G65 H28 Combined square root 2
#i + #J
2
–#K
2
Ǹ
G65 H31 Sine #i = #j · SIN (#k)
G65 H32 Cosine #i = #j · COS (#k)
G65 H33 Tangent #i = #j · TAN (#k)
G65 H34 Arctangent #i = ATAN (#j / #k)
G65 H80 Unconditional divergence GOTOn
G65 H81 Conditional divergence 1 IF#j = #k, GOTO n
G65 H82 Conditional divergence 2 IF#j 0 #k, GOTO n
G65 H83 Conditional divergence 3 IF#ju #k, GOTO n
G65 H84 Conditional divergence 4 IF#jt #k, GOTO n
G65 H85 Conditional divergence 5 IF#jx #k, GOTO n
G65 H86 Conditional divergence 6 IF#jx #k, GOTO n
G65 H99 P/S alarm occurrence P/S alarm number 500 +n occurrence