Creating Subroutines Called by G Functions
en-938872/2 5 - 7
5
Representation of machining
X
Y
1 (6 holes)
2 (4 holes) 4 (4 holes)
5 (6 holes)
3 (6 holes)
Cycle subroutine
%10199: (Equally spaced holes on the circle)
VAR
[G0/1] [RETURN] [FEED] [G94/5]
ENDV
[G0/1]=3
*
[..BG03] [G0/1]=2
*
[..BG02] + [G0/1]
Store G0, G1, G2 or G3
[G0/1]=1
*
[..BG01] + [G0/1]
[FEED]=[.RF]
Store G94 or G95
[G94/5]= 94
*
[.BG94]
[G94/5]= 95
*
[.BG95] + [G94/5]
PUSH L0 - L7
(Test whether P and R are programmed in the call block)
IF [..G80]= 1 THEN
First block in the cycle?
L0= [.IBP(1)]
*
[.IBP(3)]
G79 L0= 0 N100
Error if P or R is missing
ENDI
IF [.IBP(1)] = 1 THEN
Read next P if any
L100= [.IRP(1)]
ENDI
L100= [.IRP(1)]
Store P
G79 L100 < 1 N101
Error if P is not a positive integer
IF [.IBX(3)] = 1 THEN L925 = [.IRX(3)]
Hole bottom dimension
ENDI