The following is my Custom Macro program of my Takeda Drilling Center Fanuc 10m:
O9000(ATC CUSTOM MACRO)
#3003=1
IF[#1012EQ1]GOTO8
IF[#1013EQ1]GOTO8
IF[#1014EQ1]GOTO8
#101=#4003
#102=#4002
IF[#500NE0]GOTO1
WHILE[#1015EQ1]DO1
#3000=1(TOOL CLAMP ALARM)
END1
IF[#149NE0]GOTO1
#3000=2(T CODE ERROR/T0...T0)
N1IF[#500NE#149]GOTO2
#3003=0
M99
N2G80G49G40
IF[#149LE36]GOTO3
#3000=3(T CODE OVER DATA)
N3
IF[#1015NE0]GOTO4
T1
M90
M19
T2
N4G91G28Z0
T1
M19
IF[#500EQ0]GOTO5
G53G90G00X#[#500+500]Y0
G23
G53Z-95.45Y80.0
G53Y150.2
M91
#500=#149
#1=BCD[#149]
#1132=#1132OR63
#1132=#1132AND#1
#1115=1
G91G28Z0M92
IF[#149GT0]GOTO6
G28Y0M93
T2
G22
G#101
G#102
G61
#3003=0
#1115=0
M99
N5G91G28Y0
N6G23
G53G90G00X#[#149+500]Y150.2
T1
M91
N7G53Y150.2
G53Z-80.0M92
G53Z-95.45
M93
M90
G53Y80.0
T2
#500=#149
#1=BCD[#149]
#1132=#1132OR63
#1132=#1132AND#1
#1115=1
G91G28Z0Y0
G22
G#101
G#102
G61
N8#3003=0
#1115=0
M99
The tooling are placed along the x-axis. If I want to change the tool. The x-axis will move to the tool and clamp it into the spindle head.
If I want to change the tool, I command "Txx"(xx = tool number such as T01 is tool no. 1). And the program will excecute automatically.
My problem is I try to increase my memory by installing new ram into the motherboard. But I need to clear out all the memories including "Custom Macro Variable".
In the program, I can run it all, Clamp and Unclamp tooling and etc, the functions except,
"moving x-axis"
IF[#500EQ0]GOTO5
G53G90G00X#[#500+500]Y0
The program don't know the value of #500 Variable.
N6G23
G53G90G00X#[#149+500]Y150.2
The program don't know where to collect the value of #149 Variable. I think this is the tool number.
I don't know this Macro Program is Macro B or not.
What can I do to excecute the x-axis moving to the right position to get the tooling.
Thanks guy for your help.