13. Program Support Functions
13.5.9 Actual examples of using user macros
The following three examples will be described.
(Example 1) SIN curve
(Example 2) Bolt hole circle
(Example 3) Grid
(Example 1) SIN curve
G65 Pp1 Aa1 Bb1 Cc1 Ff1 ;
a1 ; Initial value 0°
b1 ; Final value 360°
c1 ; R of %∗SINθ
f1 ; Feedrate
Main program
G65P9910A0B360.C100.F100;
Local variable
set by argument
θ
(SIN
) Y
100.
0
-100.
To
subprogram
#1=0
#2=360.000
#3=100.000
#9=100.000
(Note 1) Commanding with one block is possible when
231
13.5 User macro specifications
90.
180.
O9910 (Subprogram)
WHILE [#1LE#2] DO1;
#101=#3 ∗ SIN [#1] ;
G90G01X#1Y#10F#9;
#1=#1+10.;
END1;
M99;
G90G01X#1Y [#3 ∗ SIN [#1]] F#9 ; is issued.
X
270.
360.
(Note 1)