
B–63172EN/01
16. CUSTOM MACRO
NC FUNCTION
89
G65 Pp Rr Aa Bb Kk ;
p : Macro number of the bolt hole circle
r : Radius
a : Initial angle
b : Angle between holes
k : Number of holes
With this function, the CNC can be graded up by the user himself. Custom
macro bodies may be offered to the users by the machine tool builder, but
the users still can make custom macro himself.
The following functions can be used for programming the custom macro
body.
Variables: #1 (i=1, 2, 3,.......)
Quotation of variables: F#33 (#33: speed expressed by variables)
Various operation can be done between variables and constants.
The following operands, and functions can be used:
+ (sum), – (difference), * (product), / (quotient), OR (logical sum), XOR
(exclusive logical sum), AND (logical product), SIN (sine), COS
(cosine), TAN (tangent), ATAN (arc tangent), SQRT (square roots), ABS
(absolute value), BIN (conversion from BCD to binary), BCD
(conversion from binary to BCD), FIX (truncation below decimal point),
FUP (raise fractions below decimal point), ROUND (round)
Example : #5 = SIN [[#2 + #4] : 3.14 + #4] : ABS (#10)
Program flow in the custom macro body is controlled by the following
command.
- If [<conditional expression>]GOTO n (n = sequence number)
When <conditional expression> is satisfied, the next execution is done
from block with sequence number n.
When <conditional expression> is not satisfied, the next block is
executed.
When the [<IF conditional expression>] is committed, it executes
from block with n unconditionally.
The following <conditional expressions> are available:
#j EQ #k whether #j = #k
#j NE #k whether #j = #k
#j GT #k whether #j > #k
#j LT #k whether #j < #k
#j GE #k whether #j y #k
#j LE #k whether #j x #k
Format
Explanations
D Use of Variable
D Operation between
variables
D Control command