I am working on a production program for a GX 480 APC. Fanuc Oi-MD controller.
Essentially, I am trying to run tool life management without reading a tool change. We tried to set up TLM before, but the tool count would never go up with a redundant tool call, it would only increase with an actual physical tool change.
There are two pallets(A&B), each with 24 collets. The program loops indefinitely with a GOTO command.
I will post my code below to show the main and internal subprogram; as well as the variable counter, and what should be the condition statements that define the tool/offset number. I think I may be going a lond way about this, but I am new to macros.
%
O3001(PART)
N1
#100=0 (COUNTER-RESET)
N3
WHILE[[0 LE #100]AND[#100 LT 3.]] DO1
G0G90G40G94G80G17
G91G0G30Z0M19
T1M6(.0925 CARB ENDMILL)
G43 H1 Z5.0
GOTO2
END1
WHILE[[2 LE #100]AND[#100 LT 5]] DO2
G0G90G40G94G80G17
G91G0G30Z0M19
T2M6(.0925 CARB ENDMILL)
G43 H2 Z5.0
GOTO2
END2
WHILE[[4 LE #100]AND[#100 LT 7]] DO3
G0G90G40G94G80G17
G91G0G30Z0M19
T3M6(.0925 CARB ENDMILL)
G43 H3 Z5.0
GOTO2
END3
/GOTO4
N2
M0(PALLET CHANGE CONFIRMATION)
M101(PALLET-A)
#100=#100+1 (PALLET-COUNT-UP-1)
M66
G54.1P1
M98Q100
M97(PART-COUNT-UP-1)
G54.1P2
M98Q100
M97(PART-COUNT-UP-1)
...(24 WORK OFFSETS)
M09
G0G90G40G94G80G17
G53 Z-6.0 M19
G53 X8.0 Y-8.0
M1
M67
M0(PALLET-CHANGE-CONFIRMATION)
M102(PALLET-B)
#100=#100+1 (PALLET-COUNT-UP-1)
M66
G54.1P25
M98Q100
M97(PART-COUNT-UP-1)
G54.1P26
M98Q100
M97(PART-COUNT-UP-1)
...(24 WORK OFFSETS)
M67
M09
G53 Z-6.0 M19
G53 X8.0 Y-8.0
GOTO3
N4
M30
N100
G90G0G80G40
(MILL CCW SUB)
G43 X-.3665 Y-.051 Z.512 S9500 M3
(CUTTING SUBPROGRAM)
M99
%
The Q100 is calling up the N100 subprogram at the end of the program. The M66/67 are for collet block clamping pressure checks, on/off.